UI preferences: #153 #155

This commit is contained in:
Scott Lamb
2021-09-01 15:01:42 -07:00
parent 33b3b669df
commit c42314edb5
11 changed files with 280 additions and 105 deletions

View File

@@ -97,9 +97,11 @@ function App() {
case "success":
setError(null);
setLoginState(
resp.response.session === undefined ? "not-logged-in" : "logged-in"
resp.response.user?.session === undefined
? "not-logged-in"
: "logged-in"
);
setSession(resp.response.session || null);
setSession(resp.response.user?.session || null);
setCameras(resp.response.cameras);
setTimeZoneName(resp.response.timeZoneName);
}

View File

@@ -145,6 +145,12 @@ async function json<T>(
export interface ToplevelResponse {
timeZoneName: string;
cameras: Camera[];
user: ToplevelUser | undefined;
}
export interface ToplevelUser {
name: string;
id: number;
session: Session | undefined;
}

View File

@@ -10,7 +10,6 @@
export type StreamType = "main" | "sub";
export interface Session {
username: string;
csrf: string;
}