diff --git a/src/components/viewmodels/settings/encryption/KeyStoragePanelViewModel.ts b/src/components/viewmodels/settings/encryption/KeyStoragePanelViewModel.ts index f0c8becb35..443434dcc9 100644 --- a/src/components/viewmodels/settings/encryption/KeyStoragePanelViewModel.ts +++ b/src/components/viewmodels/settings/encryption/KeyStoragePanelViewModel.ts @@ -11,11 +11,26 @@ import { logger } from "matrix-js-sdk/src/logger"; import { useMatrixClientContext } from "../../../../contexts/MatrixClientContext"; interface KeyStoragePanelState { - // 'null' means no backup is active. 'undefined' means we're still loading. + /** + * Whether key storage is enabled, or 'undefined' if the state is still loading. + */ isEnabled: boolean | undefined; + + /** + * A function that can be called to enable or disable key storage. + * @param enable True to turn key storage on or false to turn it off + */ setEnabled: (enable: boolean) => void; - loading: boolean; // true if the state is still loading for the first time - busy: boolean; // true if the status is in the process of being changed + + /** + * True if the state is still loading for the first time + */ + loading: boolean; + + /** + * True if the status is in the process of being changed + */ + busy: boolean; } export function useKeyStoragePanelViewModel(): KeyStoragePanelState { diff --git a/src/components/views/settings/encryption/DeleteKeyStoragePanel.tsx b/src/components/views/settings/encryption/DeleteKeyStoragePanel.tsx index ff62640e10..bcc76c48ca 100644 --- a/src/components/views/settings/encryption/DeleteKeyStoragePanel.tsx +++ b/src/components/views/settings/encryption/DeleteKeyStoragePanel.tsx @@ -16,6 +16,9 @@ import { useKeyStoragePanelViewModel } from "../../../viewmodels/settings/encryp import SdkConfig from "../../../../SdkConfig"; interface Props { + /** + * Called when the user either cancels the operation or key storage has been disabled + */ onFinish: () => void; }