Refactoring + new embedded chat:
* moving conversejs plugin in separate files * disconnecting embedded chat on navigation-end
This commit is contained in:
21
conversejs/lib/plugins/window-title.ts
Normal file
21
conversejs/lib/plugins/window-title.ts
Normal file
@ -0,0 +1,21 @@
|
||||
export const windowTitlePlugin = {
|
||||
dependencies: ['converse-muc-views'],
|
||||
overrides: {
|
||||
ChatRoomView: {
|
||||
requestUpdate: function (this: any): any {
|
||||
console.log('[livechatWindowTitlePlugin] updating the document title.')
|
||||
try {
|
||||
if (this.model?.getDisplayName) {
|
||||
const title = this.model.getDisplayName()
|
||||
if (document.title !== title) {
|
||||
document.title = title
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[livechatWindowTitlePlugin] Failed updating the window title', err)
|
||||
}
|
||||
return this.__super__.requestUpdate.apply(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user