Skip to content

Commit

Permalink
fix(external): should hard go back to app home
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Oct 27, 2024
1 parent ef46c70 commit 6786e20
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions apps/server/client/components/common/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -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">
Expand All @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion apps/server/client/pages/(login)/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Login() {
const isAuthenticated = status === "authenticated"
const onOpenInWebApp = () => {
if (isAuthenticated) {
navigate("/")
window.location.href = "/"
}
}

Expand Down
4 changes: 1 addition & 3 deletions apps/server/client/pages/(login)/redirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -44,7 +42,7 @@ export function Component() {
variant="text"
className="h-14 px-10 text-base"
onClick={() => {
navigate("/")
window.location.href = "/"
}}
>
{t("redirect.continueInBrowser")}
Expand Down

0 comments on commit 6786e20

Please sign in to comment.