diff --git a/src/languages/en.ts b/src/languages/en.ts index 41aae7be9c5a..e40fa0893776 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1173,7 +1173,9 @@ const translations = { updateRequiredView: { updateRequired: 'Update required', pleaseInstall: 'Please update to the latest version of New Expensify', + pleaseInstallExpensifyClassic: 'Please install the latest version of Expensify', toGetLatestChanges: 'For mobile or desktop, download and install the latest version. For web, refresh your browser.', + newAppNotAvailable: 'The New Expensify app is no longer available.', }, initialSettingsPage: { about: 'About', diff --git a/src/languages/es.ts b/src/languages/es.ts index 82e454fa631b..7271da67ab9e 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1172,7 +1172,9 @@ const translations = { updateRequiredView: { updateRequired: 'Actualización requerida', pleaseInstall: 'Por favor, actualiza a la última versión de New Expensify', + pleaseInstallExpensifyClassic: 'Por favor, instala la última versión de Expensify', toGetLatestChanges: 'Para móvil o escritorio, descarga e instala la última versión. Para la web, actualiza tu navegador.', + newAppNotAvailable: 'La App New Expensify ya no está disponible.', }, initialSettingsPage: { about: 'Acerca de', diff --git a/src/libs/actions/AppUpdate/updateApp/index.android.ts b/src/libs/actions/AppUpdate/updateApp/index.android.ts index 3f2cde77f466..aac98a1928aa 100644 --- a/src/libs/actions/AppUpdate/updateApp/index.android.ts +++ b/src/libs/actions/AppUpdate/updateApp/index.android.ts @@ -1,6 +1,10 @@ import {Linking, NativeModules} from 'react-native'; import CONST from '@src/CONST'; -export default function updateApp() { +export default function updateApp(isProduction: boolean) { + if (isProduction) { + Linking.openURL(CONST.APP_DOWNLOAD_LINKS.OLD_DOT_ANDROID); + return; + } Linking.openURL(NativeModules.HybridAppModule ? CONST.APP_DOWNLOAD_LINKS.OLD_DOT_ANDROID : CONST.APP_DOWNLOAD_LINKS.ANDROID); } diff --git a/src/libs/actions/AppUpdate/updateApp/index.desktop.ts b/src/libs/actions/AppUpdate/updateApp/index.desktop.ts index 5c1ecbe05742..cbd961ff653b 100644 --- a/src/libs/actions/AppUpdate/updateApp/index.desktop.ts +++ b/src/libs/actions/AppUpdate/updateApp/index.desktop.ts @@ -1,5 +1,6 @@ import ELECTRON_EVENTS from '@desktop/ELECTRON_EVENTS'; -export default function updateApp() { +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export default function updateApp(isProduction: boolean) { window.electron.send(ELECTRON_EVENTS.SILENT_UPDATE); } diff --git a/src/libs/actions/AppUpdate/updateApp/index.ios.ts b/src/libs/actions/AppUpdate/updateApp/index.ios.ts index 930a57881128..608c7ab028ca 100644 --- a/src/libs/actions/AppUpdate/updateApp/index.ios.ts +++ b/src/libs/actions/AppUpdate/updateApp/index.ios.ts @@ -1,6 +1,10 @@ import {Linking, NativeModules} from 'react-native'; import CONST from '@src/CONST'; -export default function updateApp() { +export default function updateApp(isProduction: boolean) { + if (isProduction) { + Linking.openURL(CONST.APP_DOWNLOAD_LINKS.OLD_DOT_IOS); + return; + } Linking.openURL(NativeModules.HybridAppModule ? CONST.APP_DOWNLOAD_LINKS.OLD_DOT_IOS : CONST.APP_DOWNLOAD_LINKS.IOS); } diff --git a/src/libs/actions/AppUpdate/updateApp/index.ts b/src/libs/actions/AppUpdate/updateApp/index.ts index 8c2b191029a2..3b6d9e666bfa 100644 --- a/src/libs/actions/AppUpdate/updateApp/index.ts +++ b/src/libs/actions/AppUpdate/updateApp/index.ts @@ -1,6 +1,7 @@ /** * On web or mWeb we can simply refresh the page and the user should have the new version of the app downloaded. */ -export default function updateApp() { +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export default function updateApp(isProduction: boolean) { window.location.reload(); } diff --git a/src/pages/ErrorPage/UpdateRequiredView.tsx b/src/pages/ErrorPage/UpdateRequiredView.tsx index 494ff4899887..750a3c891b0f 100644 --- a/src/pages/ErrorPage/UpdateRequiredView.tsx +++ b/src/pages/ErrorPage/UpdateRequiredView.tsx @@ -1,11 +1,12 @@ import React from 'react'; -import {View} from 'react-native'; +import {NativeModules, View} from 'react-native'; import Button from '@components/Button'; import Header from '@components/Header'; import HeaderGap from '@components/HeaderGap'; import Lottie from '@components/Lottie'; import LottieAnimations from '@components/LottieAnimations'; import Text from '@components/Text'; +import useEnvironment from '@hooks/useEnvironment'; import useLocalize from '@hooks/useLocalize'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useSafeAreaInsets from '@hooks/useSafeAreaInsets'; @@ -19,6 +20,10 @@ function UpdateRequiredView() { const StyleUtils = useStyleUtils(); const {translate} = useLocalize(); const {shouldUseNarrowLayout} = useResponsiveLayout(); + + const {isProduction} = useEnvironment(); + const isStandaloneNewAppProduction = isProduction && !NativeModules.HybridAppModule; + return ( @@ -37,17 +42,21 @@ function UpdateRequiredView() { - {translate('updateRequiredView.pleaseInstall')} + + {isStandaloneNewAppProduction ? translate('updateRequiredView.pleaseInstallExpensifyClassic') : translate('updateRequiredView.pleaseInstall')} + - {translate('updateRequiredView.toGetLatestChanges')} + + {isStandaloneNewAppProduction ? translate('updateRequiredView.newAppNotAvailable') : translate('updateRequiredView.toGetLatestChanges')} +