diff --git a/src/photos/ducks/backup/components/UpdateAppAlert.jsx b/src/photos/ducks/backup/components/UpdateAppAlert.jsx new file mode 100644 index 0000000000..05e79922fb --- /dev/null +++ b/src/photos/ducks/backup/components/UpdateAppAlert.jsx @@ -0,0 +1,16 @@ +import React from 'react' + +import { useI18n } from 'cozy-ui/transpiled/react/I18n' +import Alert from 'cozy-ui/transpiled/react/Alert' + +const UpdateAppAlert = () => { + const { t } = useI18n() + + return ( + <> + {t('Backup.UpdateAppAlert.description')} + + ) +} + +export default UpdateAppAlert diff --git a/src/photos/ducks/backup/hooks/useBackupActions.jsx b/src/photos/ducks/backup/hooks/useBackupActions.jsx index 290c0c1601..0c41bb2df1 100644 --- a/src/photos/ducks/backup/hooks/useBackupActions.jsx +++ b/src/photos/ducks/backup/hooks/useBackupActions.jsx @@ -111,7 +111,7 @@ export const BackupActionsProvider = ({ children }) => { } } - if (webviewIntent) { + if (webviewIntent && window?.cozy?.flagship?.backup_available) { check() } }, [webviewIntent, checkBackupPermissions, prepareBackup]) diff --git a/src/photos/ducks/backup/index.jsx b/src/photos/ducks/backup/index.jsx index 5eae64b43a..c7230849d8 100644 --- a/src/photos/ducks/backup/index.jsx +++ b/src/photos/ducks/backup/index.jsx @@ -10,6 +10,7 @@ import BackupInfo from './components/BackupInfo' import BackupActions from './components/BackupActions' import BackupDescription from './components/BackupDescription' import InstallAppAlert from './components/InstallAppAlert' +import UpdateAppAlert from './components/UpdateAppAlert' import LastBackupStatus from './components/LastBackupStatus' import AllowPermissionsModal from './components/AllowPermissionsModal' import { BackupError } from './components/BackupError' @@ -20,7 +21,9 @@ import { isFlagshipApp } from 'cozy-device-helper' const BackupPageContent = () => { const { isMobile } = useBreakpoints() - if (isFlagshipApp()) { + const isFlagshipAppBackupReady = window?.cozy?.flagship?.backup_available + + if (isFlagshipApp() && isFlagshipAppBackupReady) { return ( <> @@ -30,6 +33,14 @@ const BackupPageContent = () => { ) + } else if (isFlagshipApp() && !isFlagshipAppBackupReady) { + return ( + <> + + + + + ) } else { return ( <> diff --git a/src/photos/locales/en.json b/src/photos/locales/en.json index 186913cd9f..db13ea5634 100755 --- a/src/photos/locales/en.json +++ b/src/photos/locales/en.json @@ -308,6 +308,9 @@ "description": "Backup automatically all your photos and videos from your mobile devices", "install": "Install our app" }, + "UpdateAppAlert": { + "description": "Update your app to backup automatically all your photos and videos" + }, "LastBackupStatus": { "lastBackup": "Last backup: ", "success": "Success - ",