Page MenuHomePhabricator

D11186.diff
No OneTemporary

D11186.diff

diff --git a/lib/socket/report-handler.react.js b/lib/components/report-handler.react.js
rename from lib/socket/report-handler.react.js
rename to lib/components/report-handler.react.js
diff --git a/lib/socket/socket.react.js b/lib/socket/socket.react.js
--- a/lib/socket/socket.react.js
+++ b/lib/socket/socket.react.js
@@ -10,7 +10,6 @@
import CalendarQueryHandler from './calendar-query-handler.react.js';
import { InflightRequests } from './inflight-requests.js';
import MessageHandler from './message-handler.react.js';
-import ReportHandler from './report-handler.react.js';
import RequestResponseHandler from './request-response-handler.react.js';
import UpdateHandler from './update-handler.react.js';
import { updateActivityActionTypes } from '../actions/activity-actions.js';
@@ -99,7 +98,6 @@
+urlPrefix: string,
+connection: ConnectionInfo,
+currentCalendarQuery: () => CalendarQuery,
- +canSendReports: boolean,
+frozen: boolean,
+preRequestUserState: PreRequestUserState,
+noDataAfterPolicyAcknowledgment?: boolean,
@@ -375,7 +373,6 @@
frozen={this.props.frozen}
keyserverID={this.props.keyserverID}
/>
- <ReportHandler canSendReports={this.props.canSendReports} />
</React.Fragment>
);
}
diff --git a/native/components/report-handler.react.js b/native/components/report-handler.react.js
new file mode 100644
--- /dev/null
+++ b/native/components/report-handler.react.js
@@ -0,0 +1,21 @@
+// @flow
+
+import * as React from 'react';
+
+import BaseReportHandler from 'lib/components/report-handler.react.js';
+
+import { InputStateContext } from '../input/input-state.js';
+import { useSelector } from '../redux/redux-utils.js';
+
+function ReportHandler(): React.Node {
+ const inputState = React.useContext(InputStateContext);
+ const canSendReports = useSelector(
+ state =>
+ !state.frozen &&
+ state.connectivity.hasWiFi &&
+ (!inputState || !inputState.uploadInProgress()),
+ );
+ return <BaseReportHandler canSendReports={canSendReports} />;
+}
+
+export default ReportHandler;
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -46,6 +46,7 @@
import AccessTokenHandler from './components/access-token-handler.react.js';
import { FeatureFlagsProvider } from './components/feature-flags-provider.react.js';
import PersistedStateGate from './components/persisted-state-gate.js';
+import ReportHandler from './components/report-handler.react.js';
import VersionSupportedChecker from './components/version-supported.react.js';
import ConnectedStatusBar from './connected-status-bar.react.js';
import { SQLiteDataHandler } from './data/sqlite-data-handler.js';
@@ -341,6 +342,7 @@
/>
<VersionSupportedChecker />
<PrekeysHandler />
+ <ReportHandler />
</PersistedStateGate>
{navigation}
</RegistrationContextProvider>
diff --git a/native/socket.react.js b/native/socket.react.js
--- a/native/socket.react.js
+++ b/native/socket.react.js
@@ -21,7 +21,6 @@
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
-import { InputStateContext } from './input/input-state.js';
import {
activeMessageListSelector,
nativeCalendarQuery,
@@ -40,7 +39,6 @@
const NativeSocket: React.ComponentType<BaseSocketProps> =
React.memo<BaseSocketProps>(function NativeSocket(props: BaseSocketProps) {
- const inputState = React.useContext(InputStateContext);
const navContext = React.useContext(NavContext);
const { keyserverID } = props;
@@ -94,13 +92,6 @@
}),
);
- const canSendReports = useSelector(
- state =>
- !state.frozen &&
- state.connectivity.hasWiFi &&
- (!inputState || !inputState.uploadInProgress()),
- );
-
const activeThread = React.useMemo(() => {
if (!active) {
return null;
@@ -162,7 +153,6 @@
urlPrefix={urlPrefix}
connection={connection}
currentCalendarQuery={currentCalendarQuery}
- canSendReports={canSendReports}
frozen={frozen}
preRequestUserState={preRequestUserState}
dispatch={dispatch}
diff --git a/web/root.js b/web/root.js
--- a/web/root.js
+++ b/web/root.js
@@ -12,6 +12,7 @@
import IntegrityHandler from 'lib/components/integrity-handler.react.js';
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 { CallKeyserverEndpointProvider } from 'lib/keyserver-conn/call-keyserver-endpoint-provider.react.js';
import { reduxLoggerMiddleware } from 'lib/utils/action-logger.js';
@@ -56,6 +57,7 @@
<PrekeysHandler />
<SQLiteDataHandler />
<IntegrityHandler />
+ <ReportHandler canSendReports={true} />
</OlmSessionCreatorProvider>
</IdentityServiceContextProvider>
</GetOrCreateCryptoStoreProvider>
diff --git a/web/socket.react.js b/web/socket.react.js
--- a/web/socket.react.js
+++ b/web/socket.react.js
@@ -117,7 +117,6 @@
urlPrefix={urlPrefix}
connection={connection}
currentCalendarQuery={currentCalendarQuery}
- canSendReports={true}
frozen={false}
preRequestUserState={preRequestUserState}
dispatch={dispatch}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 1, 7:37 PM (20 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2400590
Default Alt Text
D11186.diff (5 KB)

Event Timeline