Addapt linting to dependency update.

This commit is contained in:
John Livingston
2025-05-12 13:01:40 +02:00
parent d36fa2e241
commit c0d2c0caae
4 changed files with 16 additions and 6 deletions

View File

@ -54,7 +54,7 @@ function overrideMUCMessageForm (_converse: any, current: Current): void {
class MUCMessageFormloaded extends MUCMessageForm {
async onFormSubmitted (ev?: Event): Promise<void> {
const announcementSelect = this.querySelector('[name=livechat-announcements]')
current.announcementType = announcementSelect?.selectedOptions?.[0]?.value || undefined
current.announcementType = announcementSelect?.selectedOptions?.[0]?.value ?? undefined
try {
await super.onFormSubmitted(ev)
if (announcementSelect) { announcementSelect.selectedIndex = 0 } // set back to default
@ -173,7 +173,7 @@ function onGetOutgoingMessageAttributes (
chatbox: any,
attrs: any
): Parameters<typeof onGetOutgoingMessageAttributes>[3] {
if (!current.announcementType) { return attrs }
if (!current.announcementType) { return attrs } // undefined or ""
const { __ } = _converse
attrs.livechat_announcement_type = current.announcementType