import { useCallback, useRef } from 'preact/hooks' import { AlertDialog, AlertDialogDescription, AlertDialogLabel } from '@reach/alert-dialog' import { WebApplication } from '@/UIModels/Application' import { AppState } from '@/UIModels/AppState' import { observer } from 'mobx-react-lite' type Props = { application: WebApplication appState: AppState } export const OtherSessionsSignOutContainer = observer((props: Props) => { if (!props.appState.accountMenu.otherSessionsSignOut) { return null } return }) const ConfirmOtherSessionsSignOut = observer(({ application, appState }: Props) => { const cancelRef = useRef(null) const closeDialog = useCallback(() => { appState.accountMenu.setOtherSessionsSignOut(false) }, [appState]) return ( End all other sessions? This action will sign out all other devices signed into your account, and remove your data from those devices when they next regain connection to the internet. You may sign back in on those devices at any time. Cancel { application.revokeAllOtherSessions().catch(console.error) closeDialog() application.alertService .alert('You have successfully revoked your sessions from other devices.', undefined, 'Finish') .catch(console.error) }} > End Sessions ) })
This action will sign out all other devices signed into your account, and remove your data from those devices when they next regain connection to the internet. You may sign back in on those devices at any time.