Skip to content

Commit

Permalink
Do not show No match found for tribute (#16231)
Browse files Browse the repository at this point in the history
Tribute.js will show an untranslated no match found if no emoji or mentions.

Further the mentions should really require a preceding space.

This PR fixes both of these.

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored Jun 23, 2021
1 parent 5f2ef17 commit d13a0e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web_src/js/features/tribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function makeCollections({mentions, emoji}) {
if (emoji) {
collections.push({
values: window.config.tributeValues,
noMatchTemplate: () => null,
requireLeadingSpace: true,
menuItemTemplate: (item) => {
return `
<div class="tribute-item">
Expand Down Expand Up @@ -69,7 +69,7 @@ export default async function attachTribute(elementOrNodeList, {mentions, emoji}
emoji: emoji || emojiNodes.length > 0,
});

const tribute = new Tribute({collection: collections});
const tribute = new Tribute({collection: collections, noMatchTemplate: ''});
for (const node of uniqueNodes) {
tribute.attach(node);
}
Expand Down

0 comments on commit d13a0e6

Please sign in to comment.