Fix ChannelMention double-constructing the comment list.
As long as the input parameters are the same, the selector will return the cached value so that we don't construct the list twice, which involves blocklist filtering.
This commit is contained in:
parent
e6caa8c7ff
commit
5204bb366e
3 changed files with 10 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { MAX_LIVESTREAM_COMMENTS } from 'constants/livestream';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
||||
import { withRouter } from 'react-router';
|
||||
|
@ -9,7 +10,11 @@ import ChannelMentionSuggestions from './view';
|
|||
|
||||
const select = (state, props) => {
|
||||
const subscriptionUris = selectSubscriptions(state).map(({ uri }) => uri);
|
||||
const topLevelComments = selectTopLevelCommentsForUri(state, props.uri);
|
||||
const topLevelComments = selectTopLevelCommentsForUri(
|
||||
state,
|
||||
props.uri,
|
||||
props.isLivestream ? MAX_LIVESTREAM_COMMENTS : -1
|
||||
);
|
||||
|
||||
const commentorUris = [];
|
||||
// Avoid repeated commentors
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { MAX_LIVESTREAM_COMMENTS } from 'constants/livestream';
|
||||
import { doResolveUris } from 'redux/actions/claims';
|
||||
import { selectClaimForUri, selectMyClaimIdsRaw } from 'redux/selectors/claims';
|
||||
import { doCommentSocketConnect, doCommentSocketDisconnect } from 'redux/actions/websocket';
|
||||
|
@ -10,9 +11,8 @@ import {
|
|||
selectSuperChatTotalAmountForUri,
|
||||
selectPinnedCommentsForUri,
|
||||
} from 'redux/selectors/comments';
|
||||
import LivestreamComments from './view';
|
||||
|
||||
const MAX_LIVESTREAM_COMMENTS = 75;
|
||||
import LivestreamComments from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: selectClaimForUri(state, props.uri),
|
||||
|
|
|
@ -3,3 +3,5 @@ export const LIVESTREAM_LIVE_API = 'https://api.live.odysee.com/v1/odysee/live';
|
|||
export const LIVESTREAM_REPLAY_API = 'https://api.live.odysee.com/v1/replays/odysee';
|
||||
export const LIVESTREAM_RTMP_URL = 'rtmp://stream.odysee.com/live';
|
||||
export const LIVESTREAM_KILL = 'https://api.stream.odysee.com/stream/kill';
|
||||
|
||||
export const MAX_LIVESTREAM_COMMENTS = 75;
|
||||
|
|
Loading…
Reference in a new issue