Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3355749
D11074.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11074.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11074: [native] Stop backup client in background
Attached
Detach File
Event Timeline
Log In to Comment