Page MenuHomePhabricator

D11655.id39131.diff
No OneTemporary

D11655.id39131.diff

diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -9,7 +9,7 @@
sortCalendarQueryPerKeyserver,
} from '../keyserver-conn/keyserver-call-utils.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
-import { preRequestUserStateSelector } from '../selectors/account-selectors.js';
+import { usePreRequestUserState } from '../selectors/account-selectors.js';
import {
getOneTimeKeyValuesFromBlob,
getPrekeyValueFromBlob,
@@ -118,7 +118,7 @@
const client = React.useContext(IdentityClientContext);
const identityClient = client?.identityClient;
- const preRequestUserState = useSelector(preRequestUserStateSelector);
+ const preRequestUserState = usePreRequestUserState();
const callKeyserverLogOut = useKeyserverCall(keyserverLogOut);
const commServicesAccessToken = useSelector(
@@ -222,7 +222,7 @@
function useDeleteKeyserverAccount(): (
keyserverIDs?: $ReadOnlyArray<string>,
) => Promise<KeyserverLogOutResult> {
- const preRequestUserState = useSelector(preRequestUserStateSelector);
+ const preRequestUserState = usePreRequestUserState();
const callKeyserverDeleteAccount = useKeyserverCall(deleteKeyserverAccount);
return React.useCallback(
@@ -242,7 +242,7 @@
const client = React.useContext(IdentityClientContext);
const identityClient = client?.identityClient;
- const preRequestUserState = useSelector(preRequestUserStateSelector);
+ const preRequestUserState = usePreRequestUserState();
const callKeyserverDeleteAccount = useKeyserverCall(deleteKeyserverAccount);
const commServicesAccessToken = useSelector(
diff --git a/lib/selectors/account-selectors.js b/lib/selectors/account-selectors.js
--- a/lib/selectors/account-selectors.js
+++ b/lib/selectors/account-selectors.js
@@ -21,6 +21,7 @@
PreRequestUserKeyserverSessionInfo,
} from '../types/session-types.js';
import type { CurrentUserInfo } from '../types/user-types.js';
+import { useSelector } from '../utils/redux-utils.js';
const logInExtraInfoSelector: (state: AppState) => LogInExtraInfo =
createSelector(
@@ -97,8 +98,12 @@
},
);
+function usePreRequestUserState(): PreRequestUserState {
+ return useSelector(preRequestUserStateSelector);
+}
+
export {
logInExtraInfoSelector,
preRequestUserStateForSingleKeyserverSelector,
- preRequestUserStateSelector,
+ usePreRequestUserState,
};

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 10:03 AM (21 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611270
Default Alt Text
D11655.id39131.diff (2 KB)

Event Timeline