This commit is contained in:
Manav Rathi 2024-05-25 07:44:16 +05:30
parent 79c0880c9c
commit 491f38b120
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View file

@ -6,7 +6,7 @@ import CopyButton from "./CopyButton";
import { CodeWrapper, CopyButtonWrapper, Wrapper } from "./styledComponents";
type Iprops = React.PropsWithChildren<{
code: string;
code: string | null;
wordBreak?: "normal" | "break-all" | "keep-all" | "break-word";
}>;

View file

@ -1,3 +1,4 @@
import { ensure } from "@/utils/ensure";
import type { PageProps } from "@ente/shared/apps/types";
import CodeBlock from "@ente/shared/components/CodeBlock";
import DialogTitleWithCloseButton from "@ente/shared/components/DialogBox/TitleWithCloseButton";
@ -28,7 +29,7 @@ interface Props {
}
function RecoveryKey({ somethingWentWrong, appContext, ...props }: Props) {
const [recoveryKey, setRecoveryKey] = useState(null);
const [recoveryKey, setRecoveryKey] = useState<string | null>(null);
useEffect(() => {
if (!props.show) {
@ -47,7 +48,7 @@ function RecoveryKey({ somethingWentWrong, appContext, ...props }: Props) {
}, [props.show]);
function onSaveClick() {
downloadAsFile(RECOVERY_KEY_FILE_NAME, recoveryKey);
downloadAsFile(RECOVERY_KEY_FILE_NAME, ensure(recoveryKey));
props.onHide();
}