Page MenuHomePhabricator

D11074.diff
No OneTemporary

D11074.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
@@ -18,28 +18,35 @@
const isAccountWithPassword = useSelector(state =>
accountHasPassword(state.currentUserInfo),
);
+ const isBackground = useSelector(
+ state => state.lifecycleState === 'background',
+ );
React.useEffect(() => {
if (!staffCanSee || !isAccountWithPassword) {
return;
}
- if (isBackupEnabled && loggedIn) {
+ if (isBackupEnabled && loggedIn && !isBackground) {
try {
commCoreModule.startBackupHandler();
} catch (err) {
console.log('Error starting backup handler:', err);
}
} else {
- void (async () => {
- try {
- await commCoreModule.stopBackupHandler();
- } catch (err) {
- console.log('Error stopping backup handler:', err);
- }
- })();
+ try {
+ commCoreModule.stopBackupHandler();
+ } catch (err) {
+ console.log('Error stopping backup handler:', err);
+ }
}
- }, [isBackupEnabled, staffCanSee, loggedIn, isAccountWithPassword]);
+ }, [
+ isBackupEnabled,
+ staffCanSee,
+ loggedIn,
+ isAccountWithPassword,
+ isBackground,
+ ]);
return null;
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 3:21 PM (21 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576547
Default Alt Text
D11074.diff (1 KB)

Event Timeline