Ver código fonte

Check existence of timeline state in community timeline (#11880)

master^2
Yamagishi Kazutoshi 4 anos atrás
committed by Eugen Rochko
pai
commit
0627252b30
1 arquivos alterados com 2 adições e 1 exclusões
  1. +2
    -1
      app/javascript/mastodon/features/community_timeline/index.js

+ 2
- 1
app/javascript/mastodon/features/community_timeline/index.js Ver arquivo

@@ -18,9 +18,10 @@ const mapStateToProps = (state, { onlyMedia, columnId }) => {
const uuid = columnId;
const columns = state.getIn(['settings', 'columns']);
const index = columns.findIndex(c => c.get('uuid') === uuid);
const timelineState = state.getIn(['timelines', `community${onlyMedia ? ':media' : ''}`]);

return {
hasUnread: state.getIn(['timelines', `community${onlyMedia ? ':media' : ''}`, 'unread']) > 0 || state.getIn(['timelines', `community${onlyMedia ? ':media' : ''}`, 'pendingItems']).size > 0,
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']),
};
};


Carregando…
Cancelar
Salvar