Page MenuHomePhabricator

D9082.diff
No OneTemporary

D9082.diff

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 = (
<ProfileRow content="Developer tools" onPress={this.onPressDevTools} />
@@ -100,7 +100,10 @@
onPress={this.onPressDefaultNotifications}
/>
);
+ }
+ let backupMenu;
+ if (staffCanSee && isAccountWithPassword) {
backupMenu = (
<ProfileRow content="Backup menu" onPress={this.onPressBackupMenu} />
);

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 12:18 AM (18 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696990
Default Alt Text
D9082.diff (1 KB)

Event Timeline