diff options
author | Reverite <github@reverite.sh> | 2019-06-09 16:54:21 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-06-09 16:54:21 -0700 |
commit | 3614718bc91f90a6dc19dd80ecf3bc191283c24e (patch) | |
tree | ad35f4dbe92fdbc3f95881d6be3d4f9b29d4a704 /app/javascript/flavours/glitch/reducers | |
parent | 846a09a7435fb9eb435e9950175ee0e696ed4909 (diff) | |
parent | e16c8fbc7a2b5a866960a87bc8c950ad0d38f61b (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/javascript/flavours/glitch/reducers')
-rw-r--r-- | app/javascript/flavours/glitch/reducers/compose.js | 1 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/reducers/timelines.js | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index 51a341c42..36dfb8f15 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -442,6 +442,7 @@ export default function compose(state = initialState, action) { map.set('focusDate', new Date()); map.set('caretPosition', null); map.set('idempotencyKey', uuid()); + map.set('sensitive', action.status.get('sensitive')); if (action.status.get('spoiler_text').length > 0) { map.set('spoiler', true); diff --git a/app/javascript/flavours/glitch/reducers/timelines.js b/app/javascript/flavours/glitch/reducers/timelines.js index cb233de1c..440b370e6 100644 --- a/app/javascript/flavours/glitch/reducers/timelines.js +++ b/app/javascript/flavours/glitch/reducers/timelines.js @@ -35,7 +35,9 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is if (!next && !isLoadingRecent) mMap.set('hasMore', false); - if (!statuses.isEmpty()) { + if (timeline.endsWith(':pinned')) { + mMap.set('items', statuses.map(status => status.get('id'))); + } else if (!statuses.isEmpty()) { mMap.update('items', ImmutableList(), oldIds => { const newIds = statuses.map(status => status.get('id')); const lastIndex = oldIds.findLastIndex(id => id !== null && compareId(id, newIds.last()) >= 0) + 1; |