diff options
| author | Henry Jameson <me@hjkos.com> | 2019-03-17 13:32:56 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-03-17 13:32:56 +0200 |
| commit | 30c0cafff168fd5e73b831d96f0539427cb25a4d (patch) | |
| tree | 6a57297f26781170e644551332042319e8a8b4b7 /src/modules/statuses.js | |
| parent | 4efcda1b4137fa14659a586d4d8559dcdd0f479b (diff) | |
| parent | 9364964b017154f61072ffa70b08f2ed0c7dcaeb (diff) | |
Merge remote-tracking branch 'upstream/develop' into mastoapi/emojis
* upstream/develop: (34 commits)
after store: fix setting postFormats field
fix user-card avatar falling into permament failed state
fix flake id users not fetching correctly
fix console error
afterStoreSetup: Move log in and theme load to afterStoreSetup.
afterStoreSetup: Handle 404 cases.
afterStoreSetup: Emoji and nodeinfo refactor.
afterStoreSetup: refactor TOS and panel fetching, handle 404s.
afterStoreSetup: refactor.
Load persistedStated with async/await.
whoops
レインせんぱいにサンキュー
fix embedded relationship card parsing
actually use embedded relationship if it's present
instead of filtering nulls, let's just not have them in the first place
#434 - fix plain text issue
Add floating post-status button on mobile
Update user settings icon to pencil
I18n: Update Czech translation
user_card.vue: Copy over .status-content img styling
...
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 7571b62a..f14b8703 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -1,4 +1,4 @@ -import { remove, slice, each, find, maxBy, minBy, merge, first, last, isArray } from 'lodash' +import { remove, slice, each, find, maxBy, minBy, merge, first, last, isArray, omitBy } from 'lodash' import apiService from '../services/api/api.service.js' // import parse from '../services/status_parser/status_parser.js' @@ -72,7 +72,9 @@ const mergeOrAdd = (arr, obj, item) => { if (oldItem) { // We already have this, so only merge the new info. - merge(oldItem, item) + // We ignore null values to avoid overwriting existing properties with missing data + // we also skip 'user' because that is handled by users module + merge(oldItem, omitBy(item, (v, k) => v === null || k === 'user')) // Reactivity fix. oldItem.attachments.splice(oldItem.attachments.length) return {item: oldItem, new: false} @@ -333,6 +335,7 @@ export const mutations = { oldTimeline.newStatusCount = 0 oldTimeline.visibleStatuses = slice(oldTimeline.statuses, 0, 50) oldTimeline.minVisibleId = last(oldTimeline.visibleStatuses).id + oldTimeline.minId = oldTimeline.minVisibleId oldTimeline.visibleStatusesObject = {} each(oldTimeline.visibleStatuses, (status) => { oldTimeline.visibleStatusesObject[status.id] = status }) }, |
