mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-10-31 22:38:58 +00:00
Backport #26461
(cherry picked from commit 9112ce22a4
)
This commit is contained in:
parent
3e48942b1e
commit
a12ea7a7cd
2 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ function makeCollections({mentions, emoji}) {
|
||||||
|
|
||||||
if (mentions) {
|
if (mentions) {
|
||||||
collections.push({
|
collections.push({
|
||||||
values: window.config.tributeValues,
|
values: window.config.tributeValues ?? [],
|
||||||
requireLeadingSpace: true,
|
requireLeadingSpace: true,
|
||||||
menuItemTemplate: (item) => {
|
menuItemTemplate: (item) => {
|
||||||
return `
|
return `
|
||||||
|
|
|
@ -32,7 +32,7 @@ export function matchMention(queryText) {
|
||||||
|
|
||||||
// results is a map of weights, lower is better
|
// results is a map of weights, lower is better
|
||||||
const results = new Map();
|
const results = new Map();
|
||||||
for (const obj of window.config.tributeValues) {
|
for (const obj of window.config.tributeValues ?? []) {
|
||||||
const index = obj.key.toLowerCase().indexOf(query);
|
const index = obj.key.toLowerCase().indexOf(query);
|
||||||
if (index === -1) continue;
|
if (index === -1) continue;
|
||||||
const existing = results.get(obj);
|
const existing = results.get(obj);
|
||||||
|
|
Loading…
Reference in a new issue