diff --git a/lib/hooks/disconnected-bar.js b/lib/hooks/keyserver-reachability.js rename from lib/hooks/disconnected-bar.js rename to lib/hooks/keyserver-reachability.js --- a/lib/hooks/disconnected-bar.js +++ b/lib/hooks/keyserver-reachability.js @@ -11,7 +11,7 @@ import { useSelector, useDispatch } from '../utils/redux-utils.js'; import { ashoatKeyserverID } from '../utils/validation-utils.js'; -function useDisconnectedBarVisibilityHandler(networkConnected: boolean): void { +function useKeyserverReachabilityHandler(networkConnected: boolean): void { const dispatch = useDispatch(); const connection = useSelector(connectionSelector(ashoatKeyserverID)); invariant(connection, 'keyserver missing from keyserverStore'); @@ -66,4 +66,4 @@ }, [connectionStatus, someRequestIsLate, setDisconnected]); } -export { useDisconnectedBarVisibilityHandler }; +export { useKeyserverReachabilityHandler }; diff --git a/native/navigation/disconnected-bar-visibility-handler.react.js b/native/navigation/disconnected-bar-visibility-handler.react.js deleted file mode 100644 --- a/native/navigation/disconnected-bar-visibility-handler.react.js +++ /dev/null @@ -1,15 +0,0 @@ -// @flow - -import { useDisconnectedBarVisibilityHandler } from 'lib/hooks/disconnected-bar.js'; - -import { useSelector } from '../redux/redux-utils.js'; - -function DisconnectedBarVisibilityHandler(): null { - const networkConnected = useSelector(state => state.connectivity.connected); - - useDisconnectedBarVisibilityHandler(networkConnected); - - return null; -} - -export default DisconnectedBarVisibilityHandler; diff --git a/native/navigation/keyserver-reachability-handler.js b/native/navigation/keyserver-reachability-handler.js new file mode 100644 --- /dev/null +++ b/native/navigation/keyserver-reachability-handler.js @@ -0,0 +1,15 @@ +// @flow + +import { useKeyserverReachabilityHandler } from 'lib/hooks/keyserver-reachability.js'; + +import { useSelector } from '../redux/redux-utils.js'; + +function KeyserverReachabilityHandler(): null { + const networkConnected = useSelector(state => state.connectivity.connected); + + useKeyserverReachabilityHandler(networkConnected); + + return null; +} + +export default KeyserverReachabilityHandler; diff --git a/native/root.react.js b/native/root.react.js --- a/native/root.react.js +++ b/native/root.react.js @@ -56,8 +56,8 @@ import { filesystemMediaCache } from './media/media-cache.js'; import { DeepLinksContextProvider } from './navigation/deep-links-context-provider.react.js'; import { defaultNavigationState } from './navigation/default-state.js'; -import DisconnectedBarVisibilityHandler from './navigation/disconnected-bar-visibility-handler.react.js'; import { setGlobalNavContext } from './navigation/icky-global.js'; +import KeyserverReachabilityHandler from './navigation/keyserver-reachability-handler.js'; import { NavContext, type NavContextType, @@ -267,7 +267,7 @@ const gated: React.Node = ( <> - + diff --git a/web/app.react.js b/web/app.react.js --- a/web/app.react.js +++ b/web/app.react.js @@ -55,9 +55,9 @@ import useBadgeHandler from './push-notif/badge-handler.react.js'; import { PushNotificationsHandler } from './push-notif/push-notifs-handler.js'; import { updateNavInfoActionType } from './redux/action-types.js'; -import { DisconnectedBarVisibilityHandler } from './redux/disconnected-bar-visibility-handler.js'; import DisconnectedBar from './redux/disconnected-bar.js'; import FocusHandler from './redux/focus-handler.react.js'; +import { KeyserverReachabilityHandler } from './redux/keyserver-reachability-handler.js'; import { persistConfig } from './redux/persist.js'; import PolicyAcknowledgmentHandler from './redux/policy-acknowledgment-handler.js'; import { useSelector } from './redux/redux-utils.js'; @@ -265,7 +265,7 @@ return (
- +