Page MenuHomePhabricator

D12223.id41023.diff
No OneTemporary

D12223.id41023.diff

diff --git a/web/settings/account-settings.react.js b/web/settings/account-settings.react.js
--- a/web/settings/account-settings.react.js
+++ b/web/settings/account-settings.react.js
@@ -2,7 +2,11 @@
import * as React from 'react';
-import { useLogOut, logOutActionTypes } from 'lib/actions/user-actions.js';
+import {
+ useLogOut,
+ logOutActionTypes,
+ useSecondaryDeviceLogOut,
+} from 'lib/actions/user-actions.js';
import { useModalContext } from 'lib/components/modal-provider.react.js';
import SWMansionIcon from 'lib/components/swmansion-icon.react.js';
import { useStringForUser } from 'lib/hooks/ens-cache.js';
@@ -14,6 +18,7 @@
createOlmSessionsWithOwnDevices,
getContentSigningKey,
} from 'lib/utils/crypto-utils.js';
+import { isDev } from 'lib/utils/dev-utils.js';
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
import css from './account-settings.css';
@@ -31,11 +36,20 @@
function AccountSettings(): React.Node {
const sendLogoutRequest = useLogOut();
+ const sendSecondaryDeviceLogoutRequest = useSecondaryDeviceLogOut();
const dispatchActionPromise = useDispatchActionPromise();
const logOutUser = React.useCallback(
() => dispatchActionPromise(logOutActionTypes, sendLogoutRequest()),
[dispatchActionPromise, sendLogoutRequest],
);
+ const logOutSecondaryDevice = React.useCallback(
+ () =>
+ dispatchActionPromise(
+ logOutActionTypes,
+ sendSecondaryDeviceLogoutRequest(),
+ ),
+ [dispatchActionPromise, sendSecondaryDeviceLogoutRequest],
+ );
const identityContext = React.useContext(IdentityClientContext);
const userID = useSelector(state => state.currentUserInfo?.id);
@@ -141,6 +155,18 @@
);
}
+ let experimentalLogOutSection;
+ if (isDev) {
+ experimentalLogOutSection = (
+ <li>
+ <span>Log out secondary device</span>
+ <Button variant="text" onClick={logOutSecondaryDevice}>
+ <p className={css.buttonText}>Log out</p>
+ </Button>
+ </li>
+ );
+ }
+
let preferences;
if (staffCanSee) {
preferences = (
@@ -257,6 +283,7 @@
<p className={css.buttonText}>Log out</p>
</Button>
</li>
+ {experimentalLogOutSection}
{changePasswordSection}
<li>
<span>Friend List</span>

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 3:24 PM (19 h, 3 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571355
Default Alt Text
D12223.id41023.diff (2 KB)

Event Timeline