From 6786e203031f18be0ca386dcaf1dddf4d05ae95b Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 27 Oct 2024 23:17:39 +0800 Subject: [PATCH] fix(external): should hard go back to app home Signed-off-by: Innei --- apps/server/client/components/common/NotFound.tsx | 5 ++--- apps/server/client/pages/(login)/login.tsx | 2 +- apps/server/client/pages/(login)/redirect.tsx | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/server/client/components/common/NotFound.tsx b/apps/server/client/components/common/NotFound.tsx index 490638e57..1579fa12b 100644 --- a/apps/server/client/components/common/NotFound.tsx +++ b/apps/server/client/components/common/NotFound.tsx @@ -1,12 +1,11 @@ import { PoweredByFooter } from "@follow/components/common/PoweredByFooter.jsx" import { Logo } from "@follow/components/icons/logo.jsx" import { Button } from "@follow/components/ui/button/index.js" -import { useLocation, useNavigate } from "react-router-dom" +import { useLocation } from "react-router-dom" export const NotFound = () => { const location = useLocation() - const navigate = useNavigate() return (
@@ -21,7 +20,7 @@ export const NotFound = () => {

- +

diff --git a/apps/server/client/pages/(login)/login.tsx b/apps/server/client/pages/(login)/login.tsx index f1ba4b2a0..4a42a44b0 100644 --- a/apps/server/client/pages/(login)/login.tsx +++ b/apps/server/client/pages/(login)/login.tsx @@ -27,7 +27,7 @@ function Login() { const isAuthenticated = status === "authenticated" const onOpenInWebApp = () => { if (isAuthenticated) { - navigate("/") + window.location.href = "/" } } diff --git a/apps/server/client/pages/(login)/redirect.tsx b/apps/server/client/pages/(login)/redirect.tsx index d02f35563..816203bb0 100644 --- a/apps/server/client/pages/(login)/redirect.tsx +++ b/apps/server/client/pages/(login)/redirect.tsx @@ -5,10 +5,8 @@ import { Button } from "@follow/components/ui/button/index.js" import { DEEPLINK_SCHEME } from "@follow/shared/constants" import { useEffect, useRef } from "react" import { useTranslation } from "react-i18next" -import { useNavigate } from "react-router-dom" export function Component() { - const navigate = useNavigate() const { t } = useTranslation("external") const getCallbackUrl = async () => { @@ -44,7 +42,7 @@ export function Component() { variant="text" className="h-14 px-10 text-base" onClick={() => { - navigate("/") + window.location.href = "/" }} > {t("redirect.continueInBrowser")}