From 5200f834f7cea62bda1cf3abcd1c739be38fe6e5 Mon Sep 17 00:00:00 2001 From: rr- Date: Mon, 8 Aug 2016 17:51:09 +0200 Subject: [PATCH] client/models: fix modifying lists in post model The lists in the post model (current state and original state) referred to the same objects, so that making changes to current state was seen as if no change has been made. This broke mass tag - it always thought there were no changes to post tags. --- client/js/models/post.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/js/models/post.js b/client/js/models/post.js index ffe80482..703da1ae 100644 --- a/client/js/models/post.js +++ b/client/js/models/post.js @@ -252,11 +252,11 @@ class Post extends events.EventTarget { _canvasHeight: response.canvasHeight, _fileSize: response.fileSize, - _flags: response.flags || [], - _tags: response.tags || [], - _notes: NoteList.fromResponse(response.notes || []), - _comments: CommentList.fromResponse(response.comments || []), - _relations: response.relations || [], + _flags: [...response.flags || []], + _tags: [...response.tags || []], + _notes: NoteList.fromResponse([...response.notes || []]), + _comments: CommentList.fromResponse([...response.comments || []]), + _relations: [...response.relations || []], _score: response.score, _favoriteCount: response.favoriteCount,