fix API added sets without listeners

fixes #1647
This commit is contained in:
LenAnderson 2024-01-07 11:13:56 +00:00
parent e3d1008aa1
commit 53c86c66eb
1 changed files with 3 additions and 7 deletions

View File

@ -38,9 +38,10 @@ export class QuickReplyConfig {
const qrl = new QuickReplySetLink();
qrl.set = qrs;
qrl.isVisible = isVisible;
this.hookQuickReplyLink(qrl);
this.setList.push(qrl);
this.setListDom.append(qrl.renderSettings(this.setList.length - 1));
this.update();
this.updateSetListDom();
}
}
removeSet(qrs) {
@ -59,12 +60,7 @@ export class QuickReplyConfig {
/**@type {HTMLElement}*/
this.setListDom = root.querySelector('.qr--setList');
root.querySelector('.qr--setListAdd').addEventListener('click', ()=>{
const qrl = new QuickReplySetLink();
qrl.set = QuickReplySet.list[0];
this.hookQuickReplyLink(qrl);
this.setList.push(qrl);
this.setListDom.append(qrl.renderSettings(this.setList.length - 1));
this.update();
this.addSet(QuickReplySet.list[0]);
});
this.updateSetListDom();
}