import * as React from "react" ; import { useSelector } from "react-redux" ; import { useCredentials } from "./credentials" ; import LoadingIndicator from "./widgets/LoadingIndicator" ; import { StoreState } from "./store" ; export function useSyncGate ( ) { const etebase = useCredentials ( ) ; const syncCount = useSelector ( ( state ) => state . syncCount ) ; const syncStatus = useSelector ( ( state ) => state . syncStatus ) ; if ( ( syncCount > 0 ) || ! etebase ) { return ( < LoadingIndicator status = { syncStatus } / > ) ; } return null ; }