Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3397282
D14033.id45994.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14033.id45994.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
@@ -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
Details
Attached
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)
Attached To
Mode
D14033: [lib] Extract hook to send logout message to primary device
Attached
Detach File
Event Timeline
Log In to Comment