From 2d75c97ed1783331d8e12cd4f6456e88b80c73f6 Mon Sep 17 00:00:00 2001 From: WlodekM Date: Fri, 24 Jan 2025 17:38:33 +0200 Subject: working maelink client --- screen/login.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'screen/login.ts') diff --git a/screen/login.ts b/screen/login.ts index bc39655..57121bb 100644 --- a/screen/login.ts +++ b/screen/login.ts @@ -1,8 +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"; +import { Input } from "../elements.ts"; export default { elements: [ @@ -38,15 +38,16 @@ export default { type: ElemType.ButtonElem, id: 'done-btn', data: ["Done", async function (this: Screen) { - client.setScreen(this) + this.client.setScreen(this) 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 + const usernameInput = this.elements.get("username-input") as Input; + const passwordInput = this.elements.get("password-input") as Input; + await this.client.login(usernameInput.value, passwordInput.value) + build(HomeScreen, this.client); + this.client }] } ], -- cgit 1.4.1-2-gfad0