Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32137512
D7666.1765028403.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7666.1765028403.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
Sat, Dec 6, 1:40 PM (15 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5838000
Default Alt Text
D7666.1765028403.diff (1 KB)
Attached To
Mode
D7666: [web-db] stop persisting drafts in redux-persist
Attached
Detach File
Event Timeline
Log In to Comment