[web][auth] Fix signups
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user