fix no op when adding QR set to global/chat and first set already included

This commit is contained in:
LenAnderson 2024-07-10 17:56:34 -04:00
parent 6d003cf140
commit 4ecfa53b3e

View File

@ -60,7 +60,12 @@ export class QuickReplyConfig {
/**@type {HTMLElement}*/
this.setListDom = root.querySelector('.qr--setList');
root.querySelector('.qr--setListAdd').addEventListener('click', ()=>{
this.addSet(QuickReplySet.list[0]);
const newSet = QuickReplySet.list.find(qr=>!this.setList.find(qrl=>qrl.set == qr));
if (newSet) {
this.addSet(newSet);
} else {
toastr.warning('All existing QR Sets have already been added.');
}
});
this.updateSetListDom();
}