v1 review pass: fixed some minor bugs

This commit is contained in:
khannurien
2026-03-16 11:08:39 +00:00
parent e88fed4e98
commit 867e64cb5b
37 changed files with 1228 additions and 400 deletions

View File

@@ -1,14 +1,14 @@
import { useState, type ReactNode } from "react";
import { type ReactNode, useState } from "react";
import { AuthContext, type AuthContextValue } from "./AuthContext.ts";
import { type AuthResponse } from "../model.ts";
import { type AuthResponse, deserializeAuthResponse } from "../model.ts";
export function AuthProvider({ children }: { children: ReactNode }) {
const [authResponse, setAuthResponse] = useState<AuthResponse | null>(() => {
const stored = localStorage.getItem("authResponse");
return stored ? JSON.parse(stored) : null;
return stored ? deserializeAuthResponse(JSON.parse(stored)) : null;
});
const value: AuthContextValue = { authResponse, setAuthResponse };