Page MenuHomePhabricator

D11366.id38268.diff
No OneTemporary

D11366.id38268.diff

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

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)

Event Timeline