about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/community_timeline/index.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-11-21 10:01:26 +0100
committerGitHub <noreply@github.com>2019-11-21 10:01:26 +0100
commit55f5e81a9dc4c6cede5d43e549061be2ea9be614 (patch)
tree6b8944b2bf8e13ba76627a0e38886dfb3b35c566 /app/javascript/flavours/glitch/features/community_timeline/index.js
parent707c4918b21d19dd53b64120dbc7263f45fc5ecd (diff)
parente87cc59811fab285033cc78d97ad7f0b8df9c081 (diff)
Merge pull request #1246 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/features/community_timeline/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/community_timeline/index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/features/community_timeline/index.js b/app/javascript/flavours/glitch/features/community_timeline/index.js
index c548824ce..7341f9702 100644
--- a/app/javascript/flavours/glitch/features/community_timeline/index.js
+++ b/app/javascript/flavours/glitch/features/community_timeline/index.js
@@ -14,15 +14,16 @@ const messages = defineMessages({
   title: { id: 'column.community', defaultMessage: 'Local timeline' },
 });
 
-const mapStateToProps = (state, { onlyMedia, columnId }) => {
+const mapStateToProps = (state, { columnId }) => {
   const uuid = columnId;
   const columns = state.getIn(['settings', 'columns']);
   const index = columns.findIndex(c => c.get('uuid') === uuid);
+  const onlyMedia = (columnId && index >= 0) ? columns.get(index).getIn(['params', 'other', 'onlyMedia']) : state.getIn(['settings', 'community', 'other', 'onlyMedia']);
   const timelineState = state.getIn(['timelines', `community${onlyMedia ? ':media' : ''}`]);
 
   return {
-    hasUnread: !!timelineState && (timelineState.get('unread') > 0 || timelineState.get('pendingItems').size > 0),
-    onlyMedia: (columnId && index >= 0) ? columns.get(index).getIn(['params', 'other', 'onlyMedia']) : state.getIn(['settings', 'community', 'other', 'onlyMedia']),
+    hasUnread: !!timelineState && timelineState.get('unread') > 0,
+    onlyMedia,
   };
 };