From 44d4059d941138166c80bbd0457c265488c5342a Mon Sep 17 00:00:00 2001 From: jedi Date: Sun, 9 Jun 2024 19:42:25 +0200 Subject: [PATCH] stash --- web/src/views/admin/Settings.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web/src/views/admin/Settings.vue b/web/src/views/admin/Settings.vue index 5823dfe..2f15a83 100644 --- a/web/src/views/admin/Settings.vue +++ b/web/src/views/admin/Settings.vue @@ -83,6 +83,20 @@ export default { }); this.fetchMessageTemplateVariables(); }, + watch: { + messageTemplates() { + for (const template of this.messageTemplates) { + if (!this.messageTemplatesIntermediate.find(t => t.id === template.id)) { + this.messageTemplatesIntermediate.push(JSON.parse(JSON.stringify(template))); + } + } + for (const template of this.messageTemplatesIntermediate) { + if (!this.messageTemplates.find(t => t.id === template.id)) { + this.messageTemplatesIntermediate = this.messageTemplatesIntermediate.filter(t => t.id !== template.id); + } + } + } + } };