Page MenuHomePhabricator

D13955.diff
No OneTemporary

D13955.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
@@ -91,6 +91,7 @@
import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js';
import { getConfig } from '../utils/config.js';
import { getMessageForException } from '../utils/errors.js';
+import { useDispatchActionPromise } from '../utils/redux-promise-utils.js';
import { useSelector } from '../utils/redux-utils.js';
import { usingCommServicesAccessToken } from '../utils/services-utils.js';
import sleep from '../utils/sleep.js';
@@ -267,6 +268,39 @@
}, [commServicesAccessToken, identityClient, preRequestUserState]);
}
+function useInvalidCSATLogOut(): () => Promise<void> {
+ const dispatchActionPromise = useDispatchActionPromise();
+
+ const preRequestUserState = usePreRequestUserState();
+ const callKeyserverLogOut = useKeyserverCall(keyserverLogOut);
+
+ const commServicesAccessToken = useSelector(
+ state => state.commServicesAccessToken,
+ );
+
+ return React.useCallback(() => {
+ const keyserverLogOutPromise = async () => {
+ console.log('wylogowuje');
+ const { keyserverIDs: _, ...result } = await callKeyserverLogOut({
+ preRequestUserState,
+ });
+ return {
+ ...result,
+ preRequestUserState: {
+ ...result.preRequestUserState,
+ commServicesAccessToken,
+ },
+ };
+ };
+ return dispatchActionPromise(logOutActionTypes, keyserverLogOutPromise());
+ }, [
+ dispatchActionPromise,
+ commServicesAccessToken,
+ callKeyserverLogOut,
+ preRequestUserState,
+ ]);
+}
+
const primaryDeviceLogOutOptions = Object.freeze({
logOutType: 'primary_device',
});
@@ -1449,4 +1483,5 @@
processNewUserIDsActionType,
versionSupportedByIdentityActionTypes,
useVersionSupportedByIdentity,
+ useInvalidCSATLogOut,
};

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 12:34 PM (20 h, 24 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2539384
Default Alt Text
D13955.diff (1 KB)

Event Timeline