diff --git a/lib/actions/client-db-store-actions.js b/lib/actions/client-db-store-actions.js --- a/lib/actions/client-db-store-actions.js +++ b/lib/actions/client-db-store-actions.js @@ -2,4 +2,6 @@ const setClientDBStoreActionType = 'SET_CLIENT_DB_STORE'; -export { setClientDBStoreActionType }; +const setDataLoadedActionType = 'SET_DATA_LOADED'; + +export { setClientDBStoreActionType, setDataLoadedActionType }; 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 @@ -1,5 +1,6 @@ // @flow +import { setDataLoadedActionType } from '../actions/client-db-store-actions.js'; import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { logOutActionTypes, @@ -14,7 +15,9 @@ state: boolean, action: BaseAction, ): boolean { - if ( + if (action.type === setDataLoadedActionType) { + return action.payload.dataLoaded; + } else if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === registerActionTypes.success diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -1136,6 +1136,12 @@ +error: true, +payload: Error, +loadingInfo: LoadingInfo, + } + | { + +type: 'SET_DATA_LOADED', + +payload: { + +dataLoaded: boolean, + }, }; export type ActionPayload = ?(Object | Array<*> | $ReadOnlyArray<*> | string);