Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3377424
D11287.id38309.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
D11287.id38309.diff
View Options
diff --git a/lib/reducers/integrity-reducer.js b/lib/reducers/integrity-reducer.js
--- a/lib/reducers/integrity-reducer.js
+++ b/lib/reducers/integrity-reducer.js
@@ -9,6 +9,7 @@
keyserverRegisterActionTypes,
} from '../actions/user-actions.js';
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
+import { integrityStoreOpsHandlers } from '../ops/integrity-store-ops.js';
import type { ThreadStoreOperation } from '../ops/thread-store-ops';
import type { IntegrityStore } from '../types/integrity-types';
import type { RawThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
@@ -16,6 +17,8 @@
import { fullStateSyncActionType } from '../types/socket-types.js';
import { hash } from '../utils/objects.js';
+const { processStoreOperations: processStoreOps } = integrityStoreOpsHandlers;
+
function reduceIntegrityStore(
state: IntegrityStore,
action: BaseAction,
@@ -51,14 +54,12 @@
.filter(([, info]) => !!info)
.map(([id, info]) => [id, hash(info)]),
);
-
- newState = {
- ...newState,
- threadHashes: {
- ...newState.threadHashes,
- ...newThreadHashes,
- },
+ const replaceOperation = {
+ type: 'replace_integrity_thread_hashes',
+ payload: { threadHashes: newThreadHashes },
};
+
+ newState = processStoreOps(state, [replaceOperation]);
}
if (action.payload.threadHashingStatus) {
newState = {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 5:36 AM (20 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2592669
Default Alt Text
D11287.id38309.diff (1 KB)
Attached To
Mode
D11287: [lib] refactor integrity reducer add new thread hashes to use sqlite ops
Attached
Detach File
Event Timeline
Log In to Comment