Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Switch

Manav Rathibe60bec4aeeb
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<string | null>(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();
}
};