[web][auth] Fix signups

This commit is contained in:
Manav Rathi
2024-10-12 17:48:55 +05:30
parent 1ac9594fe3
commit 2d7fa257cd
3 changed files with 14 additions and 6 deletions

View File

@@ -432,6 +432,7 @@ const UtilitySection: React.FC<UtilitySectionProps> = ({ closeSidebar }) => {
setWatchFolderView,
themeColor,
setThemeColor,
showMiniDialog,
} = appContext;
const { show: showRecoveryKey, props: recoveryKeyVisibilityProps } =
@@ -527,7 +528,10 @@ const UtilitySection: React.FC<UtilitySectionProps> = ({ closeSidebar }) => {
label={t("preferences")}
/>
<RecoveryKey {...recoveryKeyVisibilityProps} />
<RecoveryKey
{...recoveryKeyVisibilityProps}
{...{ showMiniDialog }}
/>
<TwoFactorModal
{...twoFactorVisibilityProps}
closeSidebar={closeSidebar}

View File

@@ -32,7 +32,7 @@ import { appHomeRoute } from "../services/redirect";
import type { PageProps } from "../types/page";
const Page: React.FC<PageProps> = ({ appContext }) => {
const { logout } = appContext;
const { logout, showMiniDialog } = appContext;
const [token, setToken] = useState<string>();
const [user, setUser] = useState<User>();
@@ -107,6 +107,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
setOpenRecoveryKey(false);
router.push(appHomeRoute);
}}
showMiniDialog={showMiniDialog}
/>
) : (
<VerticallyCentered>

View File

@@ -1,9 +1,9 @@
import { type MiniDialogAttributes } from "@/base/components/MiniDialog";
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
import { errorDialogAttributes } from "@/base/components/utils/mini-dialog";
import type { ModalVisibilityProps } from "@/base/components/utils/modal";
import { useIsSmallWidth } from "@/base/hooks";
import log from "@/base/log";
import { useAppContext } from "@/new/photos/types/context";
import { ensure } from "@/utils/ensure";
import CodeBlock from "@ente/shared/components/CodeBlock";
import DialogTitleWithCloseButton from "@ente/shared/components/DialogBox/TitleWithCloseButton";
@@ -24,12 +24,15 @@ import { downloadString } from "../utils/web";
// mobile client library only supports english.
bip39.setDefaultWordlist("english");
export const RecoveryKey: React.FC<ModalVisibilityProps> = ({
type RecoveryKeyProps = ModalVisibilityProps & {
showMiniDialog: (attributes: MiniDialogAttributes) => void;
};
export const RecoveryKey: React.FC<RecoveryKeyProps> = ({
open,
onClose,
showMiniDialog,
}) => {
const { showMiniDialog } = useAppContext();
const [recoveryKey, setRecoveryKey] = useState<string | undefined>();
const fullScreen = useIsSmallWidth();