diff --git a/lib/hooks/login-hooks.js b/lib/hooks/login-hooks.js --- a/lib/hooks/login-hooks.js +++ b/lib/hooks/login-hooks.js @@ -2,6 +2,7 @@ import * as React from 'react'; +import { setDataLoadedActionType } from '../actions/client-db-store-actions.js'; import { identityLogInActionTypes, useIdentityPasswordLogIn, @@ -11,7 +12,7 @@ import { logInActionSources } from '../types/account-types.js'; import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; import { useDispatchActionPromise } from '../utils/redux-promise-utils.js'; -import { useSelector } from '../utils/redux-utils.js'; +import { useSelector, useDispatch } from '../utils/redux-utils.js'; // We can't just do everything in one async callback, since the server calls // would get bound to Redux state from before the login. In order to pick up the @@ -98,6 +99,7 @@ ); const registeringOnAuthoritativeKeyserverRef = React.useRef(false); + const dispatch = useDispatch(); React.useEffect(() => { if ( !isRegisteredOnIdentity || @@ -118,6 +120,12 @@ hasBeenCancelled: () => false, doNotRegister: false, }); + dispatch({ + type: setDataLoadedActionType, + payload: { + dataLoaded: true, + }, + }); resolve(); } catch (e) { reject(e); @@ -126,7 +134,7 @@ registeringOnAuthoritativeKeyserverRef.current = false; } })(); - }, [currentStep, isRegisteredOnIdentity, keyserverAuth]); + }, [currentStep, isRegisteredOnIdentity, keyserverAuth, dispatch]); return returnedFunc; } diff --git a/lib/reducers/data-loaded-reducer.js b/lib/reducers/data-loaded-reducer.js --- a/lib/reducers/data-loaded-reducer.js +++ b/lib/reducers/data-loaded-reducer.js @@ -2,7 +2,6 @@ import { setDataLoadedActionType } from '../actions/client-db-store-actions.js'; import { - keyserverAuthActionTypes, logOutActionTypes, legacyLogInActionTypes, } from '../actions/user-actions.js'; @@ -28,10 +27,6 @@ return false; } else if (action.type === logOutActionTypes.started) { return false; - } else if (action.type === keyserverAuthActionTypes.success) { - if (authoritativeKeyserverID() in action.payload.updatesCurrentAsOf) { - return true; - } } return state; }