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:
John Livingston
2024-01-09 12:54:30 +01:00
parent 10406aaed0
commit d0a250a91d
4 changed files with 70 additions and 10 deletions

View File

@ -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) => {