Page MenuHomePhabricator

D12056.diff
No OneTemporary

D12056.diff

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

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)

Event Timeline