mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 05:42:10 +08:00
Merge pull request #657 from coralproject/better-refetch-detection
Better refetch detection
This commit is contained in:
@@ -297,6 +297,7 @@ class Comment extends React.Component {
|
||||
} = this.props;
|
||||
|
||||
const view = this.getVisibileReplies();
|
||||
|
||||
const hasMoreComments = comment.replies && (comment.replies.hasNextPage || comment.replies.nodes.length > view.length);
|
||||
const replyCount = this.hasIgnoredReplies() ? '' : comment.replyCount;
|
||||
const flagSummary = getActionSummary('FlagActionSummary', comment);
|
||||
|
||||
@@ -4,6 +4,7 @@ const initialState = {
|
||||
activeTab: 'stream',
|
||||
previousTab: '',
|
||||
refetching: false,
|
||||
refetchRequestId: 0,
|
||||
};
|
||||
|
||||
export default function stream(state = initialState, action) {
|
||||
@@ -18,7 +19,8 @@ export default function stream(state = initialState, action) {
|
||||
if (action.queryString.indexOf('query CoralEmbedStream_Embed(') >= 0) {
|
||||
return {
|
||||
...state,
|
||||
refetching: action.isRefetch,
|
||||
refetching: action.isRefetch ? true : state.refetching,
|
||||
refetchRequestId: action.isRefetch ? action.requestId : state.refetchRequestId,
|
||||
};
|
||||
}
|
||||
return state;
|
||||
@@ -26,7 +28,7 @@ export default function stream(state = initialState, action) {
|
||||
if (action.operationName === 'CoralEmbedStream_Embed') {
|
||||
return {
|
||||
...state,
|
||||
refetching: false,
|
||||
refetching: action.requestId === state.refetchRequestId ? false : state.refetching,
|
||||
};
|
||||
}
|
||||
return state;
|
||||
|
||||
Reference in New Issue
Block a user