fix: verify QR exists when deleting through /qr-delete

This commit is contained in:
Carsten Kragelund Jørgensen 2023-12-18 13:29:27 +01:00 committed by GitHub
parent f6b59d0d3a
commit c2ad90eb2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -798,6 +798,10 @@ async function qrDeleteCallback(args, label) {
}
const idx = preset.quickReplySlots.findIndex(x => x.label == label);
if (idx === -1) {
toastr.warning('Confirm you are using proper case sensitivity!', `QR with label '${label}' not found`);
return '';
};
preset.quickReplySlots.splice(idx, 1);
preset.numberOfSlots--;
await fetch('/savequickreply', {