diff --git a/native/backup/backup-handler.js b/native/backup/backup-handler.js --- a/native/backup/backup-handler.js +++ b/native/backup/backup-handler.js @@ -5,6 +5,7 @@ import { useSelector } from 'react-redux'; import { isLoggedIn } from 'lib/selectors/user-selectors.js'; +import { accountHasPassword } from 'lib/shared/account-utils.js'; import { getMessageForException } from 'lib/utils/errors.js'; import { BACKUP_HASH_STORAGE_KEY } from './constants.js'; @@ -24,12 +25,20 @@ ); const loggedIn = useSelector(isLoggedIn); const staffCanSee = useStaffCanSee(); + const isAccountWithPassword = useSelector(state => + accountHasPassword(state.currentUserInfo), + ); const { uploadBackupProtocol } = useClientBackup(); React.useEffect(() => { (async () => { - if (!isBackupEnabled || !loggedIn || !staffCanSee) { + if ( + !isBackupEnabled || + !loggedIn || + !staffCanSee || + !isAccountWithPassword + ) { return; } @@ -67,6 +76,7 @@ loggedIn, uploadBackupProtocol, userStore, + isAccountWithPassword, ]); return null; diff --git a/native/profile/profile-screen.react.js b/native/profile/profile-screen.react.js --- a/native/profile/profile-screen.react.js +++ b/native/profile/profile-screen.react.js @@ -87,8 +87,8 @@ } render() { - let developerTools, defaultNotifications, backupMenu; - const { staffCanSee } = this.props; + let developerTools, defaultNotifications; + const { staffCanSee, isAccountWithPassword } = this.props; if (staffCanSee) { developerTools = ( @@ -100,7 +100,10 @@ onPress={this.onPressDefaultNotifications} /> ); + } + let backupMenu; + if (staffCanSee && isAccountWithPassword) { backupMenu = ( );