Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3352702
D7666.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
D7666.diff
View Options
diff --git a/web/root.js b/web/root.js
--- a/web/root.js
+++ b/web/root.js
@@ -26,6 +26,11 @@
import Socket from './socket.react.js';
import { workerRequestMessageTypes } from './types/worker-types.js';
+const initiallyLoggedInUserID = preloadedState.currentUserInfo?.anonymous
+ ? undefined
+ : preloadedState.currentUserInfo?.id;
+const isDatabaseSupported = isSQLiteSupported(initiallyLoggedInUserID);
+
const migrations = {
[1]: async state => {
const {
@@ -43,11 +48,7 @@
};
},
[2]: async state => {
- const currentLoggedInUserID = preloadedState.currentUserInfo?.anonymous
- ? undefined
- : preloadedState.currentUserInfo?.id;
- const isSupported = isSQLiteSupported(currentLoggedInUserID);
- if (!isSupported) {
+ if (!isDatabaseSupported) {
return state;
}
@@ -69,17 +70,20 @@
return state;
},
};
+const persistWhitelist = [
+ 'enabledApps',
+ 'deviceID',
+ 'cryptoStore',
+ 'notifPermissionAlertInfo',
+ 'commServicesAccessToken',
+];
+
const persistConfig = {
key: 'root',
storage,
- whitelist: [
- 'enabledApps',
- 'deviceID',
- 'draftStore',
- 'cryptoStore',
- 'notifPermissionAlertInfo',
- 'commServicesAccessToken',
- ],
+ whitelist: isDatabaseSupported
+ ? persistWhitelist
+ : [...persistWhitelist, 'draftStore'],
migrate: (createAsyncMigrate(migrations, { debug: isDev }): any),
version: 2,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 7:01 AM (20 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574380
Default Alt Text
D7666.diff (1 KB)
Attached To
Mode
D7666: [web-db] stop persisting drafts in redux-persist
Attached
Detach File
Event Timeline
Log In to Comment