Page MenuHomePhabricator

D7666.diff
No OneTemporary

D7666.diff

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

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)

Event Timeline