Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/app/home/(with-header)/my-info/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { LoadingIndicator } from "@/components/loading/LoadingIndicator";

import Link from "next/link";
import { useRouter } from "next/navigation";
import { ArrowLeft, ChevronRight } from "lucide-react";
import { useState } from "react";
import { toast } from "sonner";
Expand Down Expand Up @@ -34,7 +33,6 @@ function providerLabel(provider: string): string {
}

export default function MyInfoPage() {
const router = useRouter();
const queryClient = useQueryClient();
const { data: user, isLoading, isFetching, refetch } = useSessionUser();

Expand All @@ -56,7 +54,7 @@ export default function MyInfoPage() {
return;
}
tearDownClientSession({ queryClient });
router.replace("/");
window.location.replace("/");
}

async function handleWithdrawConfirm() {
Expand All @@ -68,7 +66,7 @@ export default function MyInfoPage() {
clearExpenseCurrencyPreferencesForUser(user?.id);
tearDownClientSession({ queryClient });
queryClient.clear();
router.replace("/");
window.location.replace("/");
return;
}
if (result.kind === "host_delegation_required") {
Expand Down
6 changes: 3 additions & 3 deletions src/app/home/_components/HomeHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { usePathname } from "next/navigation";
import Image from "next/image";
import { useEffect, useRef, useState } from "react";
import { toast } from "sonner";
Expand All @@ -17,7 +17,6 @@ import { useSessionUser } from "@/hooks/useSessionUser";
import { tearDownClientSession } from "@/lib/client-storage";

export function HomeHeader() {
const router = useRouter();
const pathname = usePathname();
const queryClient = useQueryClient();
const [open, setOpen] = useState(false);
Expand Down Expand Up @@ -46,7 +45,8 @@ export function HomeHeader() {
return;
}
tearDownClientSession({ queryClient });
router.replace("/");
// 로그인 중 prefetch된 `/`(→ `/home` 리다이렉트)를 재사용하지 않도록 문서 이동으로 라우터 캐시를 비운다.
window.location.replace("/");
};

return (
Expand Down
Loading