Remove defunct refetch detection workaround

This commit is contained in:
Chi Vinh Le
2018-01-08 15:01:09 +01:00
parent 717d5e6566
commit be72e2effd
2 changed files with 2 additions and 19 deletions
@@ -15,23 +15,6 @@ export default function stream(state = initialState, action) {
activeTab: action.tab,
previousTab: state.activeTab,
};
case 'APOLLO_QUERY_INIT':
if (action.queryString.indexOf('query CoralEmbedStream_Embed(') >= 0) {
return {
...state,
refetching: action.isRefetch ? true : state.refetching,
refetchRequestId: action.isRefetch ? action.requestId : state.refetchRequestId,
};
}
return state;
case 'APOLLO_QUERY_RESULT':
if (action.operationName === 'CoralEmbedStream_Embed') {
return {
...state,
refetching: action.requestId === state.refetchRequestId ? false : state.refetching,
};
}
return state;
default:
return state;
}
@@ -211,7 +211,8 @@ class StreamContainer extends React.Component {
return <Spinner />;
}
const streamLoading = this.props.refetching || this.props.data.loading;
// @TODO: Detect refetch when we have apollo 2.0.
const streamLoading = this.props.data.loading;
return (
<Stream
@@ -387,7 +388,6 @@ const fragments = {
const mapStateToProps = (state) => ({
auth: state.auth,
refetching: state.embed.refetching,
activeReplyBox: state.stream.activeReplyBox,
commentId: state.stream.commentId,
assetId: state.stream.assetId,