Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Add some typing to fix typescript linter errors #20

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion src/hooks/auth.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Cookies from "js-cookie";
import { parseJWT } from "../api";
import User from "../models/User";
import { useAppStore } from "../providers/AppStoreProvider";

/** Hook to interact with authentication data within the global app store. */
Expand All @@ -16,7 +17,7 @@ const useAuth = (): {
* decoded version of the JWT for use elsewhere.
*/
const login = (jwt: string) => {
updateAppStore("auth", { jwt, user: parseJWT(jwt) });
updateAppStore("auth", { jwt, user: parseJWT(jwt) as User });
Cookies.set("jwt", jwt, {
sameSite: "strict",
expires: 7,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const HomePage: Component = () => {
<CharacterGroup
title="New Characters"
description="Recent creations from the community."
characters={query.data}
characters={query.data || []}
/>
</Suspense>
</RequiresAuth>
Expand Down