about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-06-07 17:05:32 +0200
committermultiple creatures <dev@multiple-creature.party>2019-11-19 16:39:22 -0600
commitb2f3fd782ba1b67f424168246a1d7338313c4caa (patch)
tree771682ac9fc21de9652d038e0137a997a517423b /app/javascript
parent23d379e0076e91e5651968b7af92178ba976988b (diff)
[Glitch] Fix refreshing featured toots when the new collection is empty
Port d34a3a2cc72c12ae5119150a8ac18dd8fb7a4e6b to glitch-soc
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/flavours/glitch/reducers/timelines.js4
1 files changed, 3 insertions, 1 deletions
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;