Changeset View
Changeset View
Standalone View
Standalone View
native/selectors/app-state-selectors.js
// @flow | // @flow | ||||
import * as React from 'react'; | |||||
import { useSelector } from 'react-redux'; | import { useSelector } from 'react-redux'; | ||||
import { SQLiteContext } from '../data/sqlite-context'; | |||||
function usePersistedStateLoaded(): boolean { | function usePersistedStateLoaded(): boolean { | ||||
const rehydrateConcluded = useSelector(state => !!state._persist?.rehydrated); | const rehydrateConcluded = useSelector(state => !!state._persist?.rehydrated); | ||||
const localDatabaseContext = React.useContext(SQLiteContext); | const storeLoaded = useSelector(state => state.storeLoaded); | ||||
return rehydrateConcluded && !!localDatabaseContext?.storeLoaded; | return rehydrateConcluded && storeLoaded; | ||||
} | } | ||||
export { usePersistedStateLoaded }; | export { usePersistedStateLoaded }; |