diff options
| author | Henry Jameson <me@hjkos.com> | 2019-03-25 20:32:12 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-03-25 20:32:12 +0200 |
| commit | 50960c7cfc2166ec40df3453c4e73e5c2a491a75 (patch) | |
| tree | 7fd52bf32655c9908541cc4370a24c5f00e1c690 /src/modules/statuses.js | |
| parent | 0b1506a4c00c1482dd31ee43b17ee673e9f57bde (diff) | |
| parent | 854d0e80512d2da80cd5153144698a5148da4aa6 (diff) | |
Merge remote-tracking branch 'upstream/develop' into mastoapi/followers
* upstream/develop: (87 commits)
review
Update attachment normalizer
Add fallback for attachments uploaded via the other platforms
Get correct mimetype through entity_normalizer
Set default parameter
Switch to mastoapi for posting status and uploading media
Revert changes
prevent text pasting if image is pasted
remove border radius of suggested emojis
#450 - dispatch login after saved state is loaded
#448 - fix timeline fetch error when status text is null
#451 - add class to username span
No need to fetch mutes on load anymore 🙌
switch to mastoapi
switch to mastoapi
masto api sends muted property now
No need to fetch user data using old api anymore 🎉
Switch to mastoapi
reactivity fixes
less hackery, more direct usage of mastoapi
...
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 7571b62a..a16342e0 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -1,4 +1,5 @@ -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 { set } from 'vue' import apiService from '../services/api/api.service.js' // import parse from '../services/status_parser/status_parser.js' @@ -72,7 +73,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} @@ -80,7 +83,7 @@ const mergeOrAdd = (arr, obj, item) => { // This is a new item, prepare it prepareStatus(item) arr.push(item) - obj[item.id] = item + set(obj, item.id, item) return {item, new: true} } } @@ -333,6 +336,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 }) }, |
