diff --git a/web/packages/shared/components/RecoveryKey.tsx b/web/packages/shared/components/RecoveryKey.tsx index 6f10023942..dd4d6f081a 100644 --- a/web/packages/shared/components/RecoveryKey.tsx +++ b/web/packages/shared/components/RecoveryKey.tsx @@ -1,4 +1,6 @@ import { useIsMobileWidth } from "@/base/hooks"; +import { useAppContext } from "@/new/photos/types/context"; +import { errorDialogAttributes } from "@/base/components/utils/mini-dialog"; import { ensure } from "@/utils/ensure"; import CodeBlock from "@ente/shared/components/CodeBlock"; import DialogTitleWithCloseButton from "@ente/shared/components/DialogBox/TitleWithCloseButton"; @@ -29,9 +31,14 @@ interface Props { } function RecoveryKey({ somethingWentWrong, ...props }: Props) { + const { showMiniDialog } = useAppContext(); + const [recoveryKey, setRecoveryKey] = useState(null); const fullScreen = useIsMobileWidth(); + const somethingWentWrong1 = () => + showMiniDialog(errorDialogAttributes(t("RECOVER_KEY_GENERATION_FAILED"))) + useEffect(() => { if (!props.show) { return; @@ -41,7 +48,7 @@ function RecoveryKey({ somethingWentWrong, ...props }: Props) { const recoveryKey = await getRecoveryKey(); setRecoveryKey(bip39.entropyToMnemonic(recoveryKey)); } catch (e) { - somethingWentWrong(); + somethingWentWrong1(); props.onHide(); } };