Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3398870
D12056.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12056.diff
View Options
diff --git a/web/components/version-handler.react.js b/web/components/version-handler.react.js
--- a/web/components/version-handler.react.js
+++ b/web/components/version-handler.react.js
@@ -4,28 +4,18 @@
import { useModalContext } from 'lib/components/modal-provider.react.js';
import { allConnectionInfosSelector } from 'lib/selectors/keyserver-selectors.js';
-import { isDesktopPlatform } from 'lib/types/device-types.js';
-import { getConfig } from 'lib/utils/config.js';
import css from './version-handler.css';
import Modal from '../modals/modal.react.js';
import { useSelector } from '../redux/redux-utils.js';
+import { getVersionUnsupportedError } from '../utils/version-utils.js';
function VersionUnsupportedModal(): React.Node {
const { popModal } = useModalContext();
-
- const actionRequestMessage = isDesktopPlatform(
- getConfig().platformDetails.platform,
- )
- ? 'Please reload the app'
- : 'Please refresh the page';
-
+ const message = getVersionUnsupportedError();
return (
<Modal name="App version unsupported" onClose={popModal} size="large">
- <div className={css.modalContent}>
- Your app version is pretty old, and the server doesn’t know how to speak
- to it anymore. {actionRequestMessage}.
- </div>
+ <div className={css.modalContent}>{message}</div>
</Modal>
);
}
diff --git a/web/utils/version-utils.js b/web/utils/version-utils.js
new file mode 100644
--- /dev/null
+++ b/web/utils/version-utils.js
@@ -0,0 +1,18 @@
+// @flow
+
+import { isDesktopPlatform } from 'lib/types/device-types.js';
+import { getConfig } from 'lib/utils/config.js';
+
+function getVersionUnsupportedError(): string {
+ const actionRequestMessage = isDesktopPlatform(
+ getConfig().platformDetails.platform,
+ )
+ ? 'Please reload the app'
+ : 'Please refresh the page';
+ return (
+ 'Your app version is pretty old, and the server doesn’t know how ' +
+ `to speak to it anymore. ${actionRequestMessage}.`
+ );
+}
+
+export { getVersionUnsupportedError };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 12:50 AM (21 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609527
Default Alt Text
D12056.diff (2 KB)
Attached To
Mode
D12056: [web] Factor out getVersionUnsupportedError
Attached
Detach File
Event Timeline
Log In to Comment