mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-20 15:31:30 +02:00
refactor: remove await invalidate
This commit is contained in:
@@ -16,12 +16,11 @@ import { cn } from "@/lib/utils"
|
|||||||
import { showShortcutAtom } from "@/components/shortcut/shortcut"
|
import { showShortcutAtom } from "@/components/shortcut/shortcut"
|
||||||
import { useKeyboardManager } from "@/hooks/use-keyboard-manager"
|
import { useKeyboardManager } from "@/hooks/use-keyboard-manager"
|
||||||
import { SignInButton, useAuth, useUser } from "@clerk/tanstack-start"
|
import { SignInButton, useAuth, useUser } from "@clerk/tanstack-start"
|
||||||
import { Link, useLocation, useRouter } from "@tanstack/react-router"
|
import { Link, useLocation } from "@tanstack/react-router"
|
||||||
import { ShortcutKey } from "@shared/minimal-tiptap/components/shortcut-key"
|
import { ShortcutKey } from "@shared/minimal-tiptap/components/shortcut-key"
|
||||||
import { Feedback } from "./feedback"
|
import { Feedback } from "./feedback"
|
||||||
|
|
||||||
export const ProfileSection: React.FC = () => {
|
export const ProfileSection: React.FC = () => {
|
||||||
const router = useRouter()
|
|
||||||
const { user, isSignedIn } = useUser()
|
const { user, isSignedIn } = useUser()
|
||||||
const { signOut } = useAuth()
|
const { signOut } = useAuth()
|
||||||
const [menuOpen, setMenuOpen] = React.useState(false)
|
const [menuOpen, setMenuOpen] = React.useState(false)
|
||||||
@@ -30,10 +29,7 @@ export const ProfileSection: React.FC = () => {
|
|||||||
|
|
||||||
const { disableKeydown } = useKeyboardManager("profileSection")
|
const { disableKeydown } = useKeyboardManager("profileSection")
|
||||||
|
|
||||||
const handleSignOut = async () => {
|
const handleSignOut = () => {
|
||||||
// this is no good, stupid fn, invalidate context but dont do it correctly
|
|
||||||
await router.invalidate()
|
|
||||||
|
|
||||||
signOut(() => {
|
signOut(() => {
|
||||||
window.location.replace("/")
|
window.location.replace("/")
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user