mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
fix: replace to invalidate context
This commit is contained in:
@@ -2,7 +2,7 @@ import { createFileRoute, Outlet, redirect } from "@tanstack/react-router"
|
||||
|
||||
export const Route = createFileRoute("/_layout/(auth)/_auth")({
|
||||
beforeLoad({ context }) {
|
||||
if (context.auth.userId) {
|
||||
if (context.auth?.userId) {
|
||||
throw redirect({ to: "/links", replace: true })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -89,7 +89,7 @@ export const TopicDetailHeader = React.memo(function TopicDetailHeader({
|
||||
const handleAddToProfile = (learningState: LearningStateValue) => {
|
||||
if (me?._type === "Anonymous") {
|
||||
return clerk.redirectToSignIn({
|
||||
redirectUrl: pathname,
|
||||
signInFallbackRedirectUrl: pathname,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ export const LinkItem = React.memo(
|
||||
(learningState: LearningStateValue) => {
|
||||
if (!personalLinks || !me || me?._type === "Anonymous") {
|
||||
return clerk.redirectToSignIn({
|
||||
redirectUrl: pathname,
|
||||
signInFallbackRedirectUrl: pathname,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,6 @@ export const LinkForm: React.FC<LinkFormProps> = ({
|
||||
ref.current?.contains(event.target as Node),
|
||||
)
|
||||
) {
|
||||
console.log("clicking outside")
|
||||
onClose?.()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user