Page MenuHomePhabricator

D14033.id45994.diff
No OneTemporary

D14033.id45994.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
@@ -358,13 +358,7 @@
]);
}
-const secondaryDeviceLogOutOptions = Object.freeze({
- logOutType: 'secondary_device',
-});
-
-function useSecondaryDeviceLogOut(): () => Promise<LogOutResult> {
- const logOut = useLogOut(secondaryDeviceLogOutOptions);
-
+function useSendLogoutMessageToPrimaryDevice(): () => Promise<void> {
const identityContext = React.useContext(IdentityClientContext);
if (!identityContext) {
throw new Error('Identity service client is not initialized');
@@ -398,10 +392,23 @@
[recipient],
authMetadata,
);
+ }, [identityContext, broadcastEphemeralMessage]);
+}
+
+const secondaryDeviceLogOutOptions = Object.freeze({
+ logOutType: 'secondary_device',
+});
+
+function useSecondaryDeviceLogOut(): () => Promise<LogOutResult> {
+ const logOut = useLogOut(secondaryDeviceLogOutOptions);
+ const sendLogoutMessage = useSendLogoutMessageToPrimaryDevice();
+
+ return React.useCallback(async () => {
+ await sendLogoutMessage();
// log out of identity service, keyserver and visually
return logOut();
- }, [identityContext, broadcastEphemeralMessage, logOut]);
+ }, [sendLogoutMessage, logOut]);
}
const claimUsernameActionTypes = Object.freeze({

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 2, 5:10 PM (15 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608269
Default Alt Text
D14033.id45994.diff (1 KB)

Event Timeline