Skip to content

Commit

Permalink
fixed name displaying as undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
TildaDares committed Jun 10, 2021
1 parent 589f901 commit 9098aa6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/assets/javascripts/atWhoAutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

// settings at https://github.com/ichord/At.js/wiki/Base-Document#settings

const displayName = (item) => item.username ? item.username : item.name;

var at_config = {
at: "@",
displayTpl: (item) => `<li>${item.username ? item.username : item.name}</li>`,
displayTpl: (item) => `<li>${displayName(item)}</li>`,
insertTpl: (item) => `@${displayName(item)}`,
data: '/users/active',
delay: 400,
callbacks: {
Expand Down

0 comments on commit 9098aa6

Please sign in to comment.