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

@@ -3,6 +3,7 @@ import type { SubmitEvent } from "react";
import { Link, useNavigate } from "react-router";
import { API_URL } from "../config/api.ts";
import { deserializeAuthResponse } from "../model.ts";
import { useAuth } from "../hooks/useAuth.ts";
import { PageShell } from "../components/PageShell.tsx";
@@ -38,7 +39,7 @@ export function UserRegister() {
const apiResponse = await res.json();
if (apiResponse.success) {
login(apiResponse.data);
login(deserializeAuthResponse(apiResponse.data));
navigate("/");
} else {
setState({ status: "error", error: apiResponse.error.message });
@@ -76,7 +77,11 @@ export function UserRegister() {
required
disabled={state.status === "submitting"}
/>
<button type="submit" className="btn-primary" disabled={state.status === "submitting"}>
<button
type="submit"
className="btn-primary"
disabled={state.status === "submitting"}
>
{state.status === "submitting" ? "Registering…" : "Register"}
</button>
</form>