diff options
author | Jonas Sulzer <jonas@violoncello.ch> | 2019-05-29 19:51:16 +0200 |
---|---|---|
committer | Jonas Sulzer <jonas@violoncello.ch> | 2019-05-29 19:51:16 +0200 |
commit | 2714c14e09bc5464cb5593ebcf0cd8d7774c042d (patch) | |
tree | 5ccb93eeba44725abef2e15431a785e83ba17016 | |
parent | 99b7b37e570190f75669c41a5fe03e933ab31b8b (diff) |
🐛 FIX: don't error when boosting on an Announce whereof the original Note isn't in the stream as well
Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
-rw-r--r-- | src/store/timeline.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/store/timeline.js b/src/store/timeline.js index 0e39d883..5144a6bd 100644 --- a/src/store/timeline.js +++ b/src/store/timeline.js @@ -55,13 +55,17 @@ const mutations = { state.account = account }, boostPost(state, { post, parentAnnounce }) { - Vue.set(state.timeline[post.id].action.values, 'boosted', true) + if (!typeof state.timeline[post.id] === 'undefined') { + Vue.set(state.timeline[post.id].action.values, 'boosted', true) + } if (parentAnnounce) { Vue.set(state.timeline[parentAnnounce.id].cache[parentAnnounce.object].action.values, 'boosted', true) } }, unboostPost(state, { post, parentAnnounce }) { - Vue.set(state.timeline[post.id].action.values, 'boosted', false) + if (!typeof state.timeline[post.id] === 'undefined') { + Vue.set(state.timeline[post.id].action.values, 'boosted', false) + } if (parentAnnounce) { Vue.set(state.timeline[parentAnnounce.id].cache[parentAnnounce.object].action.values, 'boosted', false) } |