aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/pages/DashboardPage.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/pages/DashboardPage.tsx')
-rw-r--r--frontend/app/pages/DashboardPage.tsx9
1 files changed, 3 insertions, 6 deletions
diff --git a/frontend/app/pages/DashboardPage.tsx b/frontend/app/pages/DashboardPage.tsx
index c81014d..708a867 100644
--- a/frontend/app/pages/DashboardPage.tsx
+++ b/frontend/app/pages/DashboardPage.tsx
@@ -2,7 +2,6 @@ import { useEffect, useState } from "react";
import { useLocation } from "wouter";
import { createApiClient } from "../api/client";
import type { components } from "../api/schema";
-import { getToken } from "../auth";
import BorderedContainerWithCaption from "../components/BorderedContainerWithCaption";
import NavigateLink from "../components/NavigateLink";
import UserIcon from "../components/UserIcon";
@@ -22,17 +21,15 @@ export default function DashboardPage() {
const [loading, setLoading] = useState(true);
useEffect(() => {
- const token = getToken();
- if (!token) return;
- const apiClient = createApiClient(token);
+ const apiClient = createApiClient();
apiClient
.getGames()
.then(({ games }) => setGames(games))
.finally(() => setLoading(false));
}, []);
- function handleLogout() {
- logout();
+ async function handleLogout() {
+ await logout();
navigate("/");
}