Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3377978
D11366.id38268.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11366.id38268.diff
View Options
diff --git a/lib/handlers/db-ops-handler.react.js b/lib/handlers/db-ops-handler.react.js
new file mode 100644
--- /dev/null
+++ b/lib/handlers/db-ops-handler.react.js
@@ -0,0 +1,26 @@
+// @flow
+
+import * as React from 'react';
+
+import { opsProcessingFinishedActionType } from '../actions/db-ops-actions.js';
+import { useDispatch, useSelector } from '../utils/redux-utils.js';
+
+function DBOpsHandler(): React.Node {
+ const noOpsActions = useSelector(state => state.dbOpsStore.noOpsActions);
+
+ const dispatch = useDispatch();
+
+ React.useEffect(() => {
+ if (noOpsActions.length === 0) {
+ return;
+ }
+ dispatch({
+ type: opsProcessingFinishedActionType,
+ payload: { actionIDs: noOpsActions },
+ });
+ }, [noOpsActions, dispatch]);
+
+ return null;
+}
+
+export { DBOpsHandler };
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -31,6 +31,7 @@
import { MediaCacheProvider } from 'lib/components/media-cache-provider.react.js';
import PrekeysHandler from 'lib/components/prekeys-handler.react.js';
import { StaffContextProvider } from 'lib/components/staff-provider.react.js';
+import { DBOpsHandler } from 'lib/handlers/db-ops-handler.react.js';
import { IdentitySearchProvider } from 'lib/identity-search/identity-search-context.js';
import { CallKeyserverEndpointProvider } from 'lib/keyserver-conn/call-keyserver-endpoint-provider.react.js';
import { TunnelbrokerProvider } from 'lib/tunnelbroker/tunnelbroker-context.js';
@@ -276,6 +277,7 @@
<BackupHandler />
<IntegrityHandler />
<AccessTokenHandler />
+ <DBOpsHandler />
</>
);
let navigation;
diff --git a/web/root.js b/web/root.js
--- a/web/root.js
+++ b/web/root.js
@@ -13,6 +13,7 @@
import KeyserverConnectionsHandler from 'lib/components/keyserver-connections-handler.js';
import PrekeysHandler from 'lib/components/prekeys-handler.react.js';
import ReportHandler from 'lib/components/report-handler.react.js';
+import { DBOpsHandler } from 'lib/handlers/db-ops-handler.react.js';
import { CallKeyserverEndpointProvider } from 'lib/keyserver-conn/call-keyserver-endpoint-provider.react.js';
import { reduxLoggerMiddleware } from 'lib/utils/action-logger.js';
@@ -65,6 +66,7 @@
<SQLiteDataHandler />
<IntegrityHandler />
<ReportHandler canSendReports={true} />
+ <DBOpsHandler />
</OlmSessionCreatorProvider>
</IdentityServiceContextProvider>
</GetOrCreateCryptoStoreProvider>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 8:28 AM (20 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2593398
Default Alt Text
D11366.id38268.diff (2 KB)
Attached To
Mode
D11366: [lib] Introduce a handler that processes the ops
Attached
Detach File
Event Timeline
Log In to Comment