diff --git a/lib/components/integrity-handler.react.js b/lib/components/integrity-handler.react.js --- a/lib/components/integrity-handler.react.js +++ b/lib/components/integrity-handler.react.js @@ -22,7 +22,13 @@ React.useEffect(() => { if (integrityStore.threadHashingStatus === 'starting') { - const threadIDs = Object.keys(threadInfos); + const integrityStoreThreads = new Set( + Object.keys(integrityStore.threadHashes), + ); + + const threadIDs = Object.keys(threadInfos).filter( + key => !integrityStoreThreads.has(key), + ); setBatches(splitIntoChunks(threadIDs, BATCH_SIZE)); dispatch({ type: updateIntegrityStoreActionType, @@ -32,7 +38,12 @@ clearTimeout(timeout.current); setBatches(null); } - }, [dispatch, integrityStore.threadHashingStatus, threadInfos]); + }, [ + dispatch, + integrityStore.threadHashes, + integrityStore.threadHashingStatus, + threadInfos, + ]); React.useEffect(() => { if (!batches) { diff --git a/lib/reducers/integrity-reducer.js b/lib/reducers/integrity-reducer.js --- a/lib/reducers/integrity-reducer.js +++ b/lib/reducers/integrity-reducer.js @@ -4,6 +4,7 @@ import { updateIntegrityStoreActionType } from '../actions/integrity-actions.js'; import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { + keyserverAuthActionTypes, logInActionTypes, registerActionTypes, } from '../actions/user-actions.js'; @@ -30,6 +31,8 @@ state.threadHashingStatus !== 'completed') ) { return { threadHashes: {}, threadHashingStatus: 'starting' }; + } else if (action.type === keyserverAuthActionTypes.success) { + return { ...state, threadHashingStatus: 'starting' }; } let newState = state; if (action.type === updateIntegrityStoreActionType) {