Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3528139
D10812.id36330.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D10812.id36330.diff
View Options
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 = (
<>
<LifecycleHandler />
- <DisconnectedBarVisibilityHandler />
+ <KeyserverReachabilityHandler />
<DimensionsUpdater />
<ConnectivityUpdater />
<ThemeHandler />
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 (
<div className={css.layout}>
- <DisconnectedBarVisibilityHandler />
+ <KeyserverReachabilityHandler />
<DisconnectedBar />
<UpdateModalHandler />
<header
diff --git a/web/redux/disconnected-bar.js b/web/redux/disconnected-bar.js
--- a/web/redux/disconnected-bar.js
+++ b/web/redux/disconnected-bar.js
@@ -3,8 +3,8 @@
import classNames from 'classnames';
import * as React from 'react';
-import { useNetworkConnected } from './disconnected-bar-visibility-handler.js';
import css from './disconnected-bar.css';
+import { useNetworkConnected } from './keyserver-reachability-handler.js';
function DisconnectedBar(): React.Node {
const isNetworkConnected = useNetworkConnected();
diff --git a/web/redux/disconnected-bar-visibility-handler.js b/web/redux/keyserver-reachability-handler.js
rename from web/redux/disconnected-bar-visibility-handler.js
rename to web/redux/keyserver-reachability-handler.js
--- a/web/redux/disconnected-bar-visibility-handler.js
+++ b/web/redux/keyserver-reachability-handler.js
@@ -2,7 +2,7 @@
import * as React from 'react';
-import { useDisconnectedBarVisibilityHandler } from 'lib/hooks/disconnected-bar.js';
+import { useKeyserverReachabilityHandler } from 'lib/hooks/keyserver-reachability.js';
function useNetworkConnected(): boolean {
const [networkConnected, setNetworkConnected] = React.useState(true);
@@ -24,10 +24,10 @@
return networkConnected;
}
-function DisconnectedBarVisibilityHandler(): null {
+function KeyserverReachabilityHandler(): null {
const networkConnected = useNetworkConnected();
- useDisconnectedBarVisibilityHandler(networkConnected);
+ useKeyserverReachabilityHandler(networkConnected);
return null;
}
-export { useNetworkConnected, DisconnectedBarVisibilityHandler };
+export { useNetworkConnected, KeyserverReachabilityHandler };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:19 AM (9 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2702032
Default Alt Text
D10812.id36330.diff (5 KB)
Attached To
Mode
D10812: Rename `useDisconnectedBarVisibilityHandler` to `useKeyserverReachabilityHandler`
Attached
Detach File
Event Timeline
Log In to Comment