commit: 4c5d60ab850b5d553cc5076bad0665029be45c0b
parent: 0df3ca47a49be71c813c558f3a98286a6bc0c74b
Author: Roger Braun <roger@rogerbraun.net>
Date: Thu, 1 Dec 2016 18:05:20 +0100
Reactivity fixes for attachments.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
@@ -45,6 +45,9 @@ export const prepareStatus = (status) => {
status.nsfw = !!status.text.match(nsfwRegex)
}
+ // To make the array reactive
+ status.attachments = status.attachments || []
+
return status
}
@@ -77,6 +80,8 @@ const mergeOrAdd = (arr, item) => {
if (oldItem) {
// We already have this, so only merge the new info.
merge(oldItem, item)
+ // Reactivity fix.
+ oldItem.attachments.splice(oldItem.attachments.length)
return {item: oldItem, new: false}
} else {
// This is a new item, prepare it