aboutsummaryrefslogtreecommitdiffstats
path: root/ui/src/state/models.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/state/models.ts')
-rw-r--r--ui/src/state/models.ts16
1 files changed, 11 insertions, 5 deletions
diff --git a/ui/src/state/models.ts b/ui/src/state/models.ts
index 57db44ae..c1d97f4b 100644
--- a/ui/src/state/models.ts
+++ b/ui/src/state/models.ts
@@ -1,12 +1,18 @@
import Database from "@tauri-apps/plugin-sql";
-export interface User {
- username: string;
+export class User {
+ username: string | null;
+
+ constructor(username: string) {
+ this.username = username;
+ }
+
+ isLoggedIn(): boolean {
+ return this.username !== "" && this.username !== null;
+ }
}
-export const DefaultUser: User = {
- username: "",
-};
+export const DefaultUser: User = new User("");
export interface HomeInfo {
historyCount: number;