fix(external): should hard go back to app home

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2024-10-27 23:17:39 +08:00
parent ef46c70a98
commit 6786e20303
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
3 changed files with 4 additions and 7 deletions

View File

@ -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 (
<div className="prose center m-auto size-full flex-col dark:prose-invert">
<main className="flex grow flex-col items-center justify-center">
@ -21,7 +20,7 @@ export const NotFound = () => {
</p>
<p>
<Button onClick={() => navigate("/")}>Back to Home</Button>
<Button onClick={() => (window.location.href = "/")}>Back to Home</Button>
</p>
</main>

View File

@ -27,7 +27,7 @@ function Login() {
const isAuthenticated = status === "authenticated"
const onOpenInWebApp = () => {
if (isAuthenticated) {
navigate("/")
window.location.href = "/"
}
}

View File

@ -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")}