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
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -164,7 +164,14 @@ export default {
if (label.createdBy.id !== this.userInfo.id) { if (label.createdBy.id !== this.userInfo.id) {
return 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.isLabelEdit = true
// This makes the editor trigger its mounted function again which makes it forget every input // This makes the editor trigger its mounted function again which makes it forget every input