diff options
| author | dave <starpumadev@gmail.com> | 2019-03-25 10:22:16 -0400 |
|---|---|---|
| committer | dave <starpumadev@gmail.com> | 2019-03-25 10:22:16 -0400 |
| commit | 4cec0d589dfc54987ec6f024b0a463d0abd847d2 (patch) | |
| tree | a88953cc409d162127edb43a702d6540c64c023e /src/modules/statuses.js | |
| parent | 63d7c7bd80cf8028cdefee99c1cb75614385f96b (diff) | |
| parent | 01d05316998f90451e920f8ac8d4c264a13b0cd7 (diff) | |
Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma-fe into issue-433-status-reply-form
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} |
