Switch
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user