Fix label changes appearing to be saved immediately when editing them

This commit is contained in:
kolaente 2021-07-22 22:03:49 +02:00
parent 926d7938ab
commit fe4a8c17c8
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 8 additions and 1 deletions

View File

@ -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