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 = ( +
Log out
+ {experimentalLogOutSection} {changePasswordSection}