Refactor state

This commit is contained in:
2025-11-18 23:21:30 +03:00
Unverified
parent c6c60e6404
commit dc4536cabc
43 changed files with 720 additions and 866 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import type { ReactNode } from "react";
import { useAppState } from "./chat/state";
import { useUserStore } from "@/state/user";
import { Navigate } from "react-router-dom";
interface ProtectedRouteProps {
@@ -7,7 +7,7 @@ interface ProtectedRouteProps {
}
export default function ProtectedRoute({ children }: ProtectedRouteProps) {
const { user } = useAppState();
const { user } = useUserStore();
return !user.authToken ? <Navigate to="/login" /> : children;
}