mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 08:21:07 +00:00
chat: small cleanup.hmmm, how to handle duplicates? see https://workflowy.com/shared/3ca12ef1-8335-f196-1b74-c1955402c5f5/
This commit is contained in:
parent
8db131dbda
commit
8aee3c7446
1 changed files with 5 additions and 2 deletions
|
|
@ -90,7 +90,8 @@ module.exports.app = (appExports, model, app) ->
|
|||
text = model.get input
|
||||
# Check for non-whitespace characters
|
||||
return unless /\S/.test text
|
||||
chat.unshift
|
||||
|
||||
message =
|
||||
id: model.id()
|
||||
uuid: user.get('id')
|
||||
contributor: user.get('backer.contributor')
|
||||
|
|
@ -98,8 +99,10 @@ module.exports.app = (appExports, model, app) ->
|
|||
text: text
|
||||
user: helpers.username(model.get('_user.auth'), model.get('_user.profile.name'))
|
||||
timestamp: +new Date
|
||||
|
||||
# FIXME how to remove duplicates ?
|
||||
chat.unshift message, -> chat.remove 200 # keep a max messages cap
|
||||
model.set(input, '')
|
||||
chat.remove 200 # keep a max messages cap
|
||||
|
||||
model.on 'unshift', '_party.chat', -> $('.chat-message').tooltip()
|
||||
model.on 'unshift', '_tavern.chat.messages', -> $('.chat-message').tooltip()
|
||||
|
|
|
|||
Loading…
Reference in a new issue