Better Anonymous chat user UX:
* Remember the chosen nickname in sessionStorage, to avoid entering it again too often. * Fix: if an anonymous chat user enter spaces in the nickname choice, it will allows them to keep the random nickname.
This commit is contained in:
@ -6,8 +6,13 @@ import tplMucBottomPanel from '../../src/plugins/muc-views/templates/muc-bottom-
|
||||
async function setNickname (ev, model) {
|
||||
ev.preventDefault()
|
||||
const nick = ev.target.nick.value.trim()
|
||||
nick && await model.setNickname(nick)
|
||||
_converse.api.trigger('livechatViewerModeSetNickname')
|
||||
if (!nick) {
|
||||
return
|
||||
}
|
||||
await model.setNickname(nick)
|
||||
_converse.api.trigger('livechatViewerModeSetNickname', model, nick, {
|
||||
synchronous: true
|
||||
})
|
||||
}
|
||||
|
||||
export default (o) => {
|
||||
|
Reference in New Issue
Block a user