Skip to content

Commit 9f6e580

Browse files
author
Filip
committed
feat(web-app): move modals to dedicated routes
1 parent 8946568 commit 9f6e580

File tree

13 files changed

+878
-744
lines changed

13 files changed

+878
-744
lines changed

apps/web-app/app/app-navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function AppNavbar({ user }: { user: User | null }) {
2424
<NavbarContent className="hidden sm:flex gap-4" justify="center">
2525
<NavbarItem>
2626
<NavLink
27-
to="/"
27+
to="/links"
2828
className={({ isActive }) =>
2929
isActive ? "text-primary font-semibold" : "text-foreground"
3030
}

apps/web-app/app/root.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { authClient } from "./auth-client";
1414
import { userContext } from "./context";
1515
import "./app.css";
1616
import { AppNavbar } from "./app-navbar";
17+
import { clearQueryCache } from "./data/cache";
1718

1819
export const links: Route.LinksFunction = () => [
1920
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
@@ -46,7 +47,19 @@ const authMiddleware: Route.ClientMiddlewareFunction = async (
4647
throw redirect("/auth/login");
4748
};
4849

50+
const clearQueryCacheMiddleware: Route.ClientMiddlewareFunction = async (
51+
{ request },
52+
next,
53+
) => {
54+
if (request.method === "POST") {
55+
clearQueryCache();
56+
}
57+
58+
return next();
59+
};
60+
4961
export const clientMiddleware: Route.ClientMiddlewareFunction[] = [
62+
clearQueryCacheMiddleware,
5063
authMiddleware,
5164
];
5265

0 commit comments

Comments
 (0)