add console warning when delete set is not found in list

This commit is contained in:
LenAnderson 2024-07-22 19:06:02 -04:00
parent 133a3663f4
commit 3b2dcd60da
1 changed files with 6 additions and 2 deletions

View File

@ -408,8 +408,12 @@ export class QuickReplySet {
if (response.ok) {
this.unrender();
const idx = QuickReplySet.list.indexOf(this);
QuickReplySet.list.splice(idx, 1);
this.isDeleted = true;
if (idx > -1) {
QuickReplySet.list.splice(idx, 1);
this.isDeleted = true;
} else {
warn(`Deleted Quick Reply Set was not found in the list of sets: ${this.name}`);
}
} else {
warn(`Failed to delete Quick Reply Set: ${this.name}`);
}