Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32197538
D9110.1765103743.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
D9110.1765103743.diff
View Options
diff --git a/web/redux/persist.js b/web/redux/persist.js
--- a/web/redux/persist.js
+++ b/web/redux/persist.js
@@ -54,27 +54,6 @@
};
},
[2]: async state => {
- const databaseModule = await getDatabaseModule();
- const isDatabaseSupported = await databaseModule.isDatabaseSupported();
- if (!isDatabaseSupported) {
- return state;
- }
-
- const { drafts } = state.draftStore;
- const draftStoreOperations = [];
- for (const key in drafts) {
- const text = drafts[key];
- draftStoreOperations.push({
- type: 'update',
- payload: { key, text },
- });
- }
-
- await databaseModule.schedule({
- type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
- storeOperations: { draftStoreOperations },
- });
-
return state;
},
[3]: async (state: AppState) => {
@@ -125,6 +104,34 @@
},
};
},
+ [5]: async state => {
+ const databaseModule = await getDatabaseModule();
+ const isDatabaseSupported = await databaseModule.isDatabaseSupported();
+ if (!isDatabaseSupported) {
+ return state;
+ }
+
+ if (!state.draftStore) {
+ return state;
+ }
+
+ const { drafts } = state.draftStore;
+ const draftStoreOperations = [];
+ for (const key in drafts) {
+ const text = drafts[key];
+ draftStoreOperations.push({
+ type: 'update',
+ payload: { key, text },
+ });
+ }
+
+ await databaseModule.schedule({
+ type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
+ storeOperations: { draftStoreOperations },
+ });
+
+ return state;
+ },
};
const persistWhitelist = [
@@ -240,7 +247,7 @@
{ debug: isDev },
migrateStorageToSQLite,
): any),
- version: 4,
+ version: 5,
transforms: [keyserverStoreTransform],
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 10:35 AM (20 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5840758
Default Alt Text
D9110.1765103743.diff (1 KB)
Attached To
Mode
D9110: [web] Migrate drafts to db for everyone
Attached
Detach File
Event Timeline
Log In to Comment