New embedded chat: spinner while loading

This commit is contained in:
John Livingston
2024-03-26 17:38:40 +01:00
parent b6478f0f9e
commit 67a1a6e32d
3 changed files with 44 additions and 1 deletions

View File

@ -137,6 +137,13 @@ window.initConverse = async function initConverse (
// livechatSpecifics plugins add some customization for the livechat plugin.
converse.plugins.add('livechatSpecifics', {
dependencies: ['converse-muc', 'converse-muc-views'],
initialize: function () {
const _converse = this._converse
_converse.api.listen.on('chatRoomViewInitialized', function (this: any, _model: any): void {
// Remove the spinner if present...
document.getElementById('livechat-loading-spinner')?.remove()
})
},
overrides: {
ChatRoom: {
getActionInfoMessage: function (this: any, code: string, nick: string, actor: any): any {