| 470 | 470 | toastr.error(`A Quick Reply Set named "${newName}" already exists.`); |
| 471 | 471 | return; |
| 472 | 472 | } |
| 473 | 473 | const newQrSet = QuickReplySet.from(JSON.parse(JSON.stringify(this.currentQrSet).toJSON()); |
| 474 | 474 | newQrSet.name = newName; |
| 475 | 475 | newQrSet.qrList = this.currentQrSet.qrList.map(qr => QuickReply.from(JSON.parse(JSONqr.stringifytoJSON(qr)))); |
| 476 | 476 | newQrSet.addQuickReplyinit(); |
| 477 | 477 | const idx = QuickReplySet.list.findIndex(it => it.name.toLowerCase().localeCompare(newName.toLowerCase()) == 1); |
| 478 | 478 | if (idx > -1) { |
| 479 | 479 | QuickReplySet.list.splice(idx, 0, newQrSet); |