From fe4a8c17c8a07b72f5b0504670f461a8b97969c8 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 22 Jul 2021 22:03:49 +0200 Subject: [PATCH] Fix label changes appearing to be saved immediately when editing them --- src/views/labels/ListLabels.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/views/labels/ListLabels.vue b/src/views/labels/ListLabels.vue index e286c952..e5f67a30 100644 --- a/src/views/labels/ListLabels.vue +++ b/src/views/labels/ListLabels.vue @@ -164,7 +164,14 @@ export default { if (label.createdBy.id !== this.userInfo.id) { return } - this.labelEditLabel = label + // Duplicating the label to make sure it does not look like changes take effect immediatly as the label + // object passed to this function here still has a reference to the store. + this.labelEditLabel = new LabelModel({ + id: label.id, + title: label.title, + description: label.description, + hexColor: label.hexColor, + }) this.isLabelEdit = true // This makes the editor trigger its mounted function again which makes it forget every input