summary refs log tree commit diff
path: root/v2/screen/login.ts
diff options
context:
space:
mode:
Diffstat (limited to 'v2/screen/login.ts')
-rw-r--r--v2/screen/login.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/v2/screen/login.ts b/v2/screen/login.ts
index c9e4fec..525127b 100644
--- a/v2/screen/login.ts
+++ b/v2/screen/login.ts
@@ -1,4 +1,8 @@
 import { ElemType } from "../screenbuilder.ts";
+import { Screen } from "../screen.ts";
+import * as client from "../client.ts"
+import { build } from "../screenbuilder.ts";
+import HomeScreen from "./home.ts";
 
 export default {
     elements: [
@@ -25,7 +29,16 @@ export default {
         {
             type: ElemType.ButtonElem,
             id: 'done-btn',
-            data: ["Done"]
+            data: ["Done", async function (this: Screen) {
+                this.off()
+                this.logs.push(`clicked button`)
+                console.clear()
+                console.log("logging in...")
+                //@ts-ignore
+                await client.login(this.elements.get("username-input").value, this.elements.get("password-input").value)
+                build(HomeScreen);
+                client
+            }]
         }
     ],
     focus: "username-input",