Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3401024
D11655.id39131.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
D11655.id39131.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11655: [lib] Introduce usePreRequestUserState
Attached
Detach File
Event Timeline
Log In to Comment