diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-03-15 13:14:41 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-03-15 13:14:41 +0000 |
| commit | 9364964b017154f61072ffa70b08f2ed0c7dcaeb (patch) | |
| tree | bcc17450b6d66df1c12acf25eea05fb5d4ed34ab /src/modules/statuses.js | |
| parent | 92eb55c7bc3cf210b86259b99c3e2b8f192bf325 (diff) | |
| parent | 71c12fa3a58ff2b498ed5ba9d3fc3d58d016bd97 (diff) | |
Merge branch 'mastoapi/user-stuff' into 'develop'
Transition to MastoAPI: user data
See merge request pleroma/pleroma-fe!655
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 6b512fa3..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} |
