UNPKG

matrix-react-sdk

Version:
52 lines (51 loc) 2.02 kB
import React from "react"; import { MatrixClient } from "matrix-js-sdk/src/matrix"; interface IProps { onFinished: (success: boolean) => void; } declare enum BackupStatus { /** we're trying to figure out if there is an active backup */ LOADING = 0, /** crypto is disabled in this client (so no need to back up) */ NO_CRYPTO = 1, /** Key backup is active and working */ BACKUP_ACTIVE = 2, /** there is a backup on the server but we are not backing up to it */ SERVER_BACKUP_BUT_DISABLED = 3, /** backup is not set up locally and there is no backup on the server */ NO_BACKUP = 4, /** there was an error fetching the state */ ERROR = 5 } interface IState { backupStatus: BackupStatus; } /** * Checks if the `LogoutDialog` should be shown instead of the simple logout flow. * The `LogoutDialog` will check the crypto recovery status of the account and * help the user setup recovery properly if needed. */ export declare function shouldShowLogoutDialog(cli: MatrixClient): Promise<boolean>; export default class LogoutDialog extends React.Component<IProps, IState> { static defaultProps: { onFinished: () => void; }; constructor(props: IProps); /** kick off the asynchronous calls to populate `state.backupStatus` in the background */ private startLoadBackupStatus; private loadBackupStatus; private onExportE2eKeysClicked; private onFinished; private onSetRecoveryMethodClick; private onLogoutConfirm; /** * Show a dialog prompting the user to set up key backup. * * Either there is no backup at all ({@link BackupStatus.NO_BACKUP}), there is a backup on the server but * we are not connected to it ({@link BackupStatus.SERVER_BACKUP_BUT_DISABLED}), or we were unable to pull the * backup data ({@link BackupStatus.ERROR}). In all three cases, we should prompt the user to set up key backup. */ private renderSetupBackupDialog; render(): React.ReactNode; } export {};