diff --git a/lib/reducers/data-loaded-reducer.js b/lib/reducers/data-loaded-reducer.js index 983b12c7b..a0d229597 100644 --- a/lib/reducers/data-loaded-reducer.js +++ b/lib/reducers/data-loaded-reducer.js @@ -1,34 +1,40 @@ // @flow import { setDataLoadedActionType } from '../actions/client-db-store-actions.js'; import { + keyserverAuthActionTypes, logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, } from '../actions/user-actions.js'; import type { BaseAction } from '../types/redux-types.js'; import { setNewSessionActionType } from '../utils/action-utils.js'; +import { ashoatKeyserverID } from '../utils/validation-utils.js'; export default function reduceDataLoaded( state: boolean, action: BaseAction, ): boolean { if (action.type === setDataLoadedActionType) { return action.payload.dataLoaded; } else if (action.type === logInActionTypes.success) { return true; } else if ( action.type === setNewSessionActionType && action.payload.sessionChange.currentUserInfo && action.payload.sessionChange.currentUserInfo.anonymous ) { return false; } else if ( action.type === logOutActionTypes.started || action.type === logOutActionTypes.success || action.type === deleteKeyserverAccountActionTypes.success ) { return false; + } else if (action.type === keyserverAuthActionTypes.success) { + if (ashoatKeyserverID in action.payload.updatesCurrentAsOf) { + return true; + } } return state; } diff --git a/lib/reducers/theme-reducer.js b/lib/reducers/theme-reducer.js index 6ba0ceaf7..1635b76df 100644 --- a/lib/reducers/theme-reducer.js +++ b/lib/reducers/theme-reducer.js @@ -1,47 +1,49 @@ // @flow import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { updateThemeInfoActionType } from '../actions/theme-actions.js'; import { logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, registerActionTypes, + tempIdentityLoginActionTypes, } from '../actions/user-actions.js'; import type { BaseAction } from '../types/redux-types.js'; import { defaultGlobalThemeInfo, type GlobalThemeInfo, } from '../types/theme-types.js'; import { setNewSessionActionType } from '../utils/action-utils.js'; export default function reduceGlobalThemeInfo( state: GlobalThemeInfo, action: BaseAction, ): GlobalThemeInfo { if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || - action.type === registerActionTypes.success + action.type === registerActionTypes.success || + action.type === tempIdentityLoginActionTypes.success ) { return defaultGlobalThemeInfo; } else if ( action.type === setNewSessionActionType && action.payload.sessionChange.currentUserInfo && action.payload.sessionChange.currentUserInfo.anonymous ) { return defaultGlobalThemeInfo; } else if ( action.type === logOutActionTypes.started || action.type === logOutActionTypes.success || action.type === deleteKeyserverAccountActionTypes.success ) { return defaultGlobalThemeInfo; } else if (action.type === updateThemeInfoActionType) { return { ...state, ...action.payload, }; } return state; }