diff options
author | wlodekm <[email protected]> | 2025-01-24 17:51:45 +0200 |
---|---|---|
committer | WlodekM <[email protected]> | 2025-01-24 18:05:00 +0200 |
commit | 2c8abffae1f73087847bebb70ea354fcaaa2b69a (patch) | |
tree | 0fdbf3379b0d7eba3565250f364fede49f307921 | |
parent | 98980ea477be08e76d139584e8c79c1424328469 (diff) |
remove debugging
-rw-r--r-- | client.ts | 10 | ||||
-rw-r--r-- | screen.ts | 5 |
2 files changed, 3 insertions, 12 deletions
diff --git a/client.ts b/client.ts index 93b3dc5..02397d0 100644 --- a/client.ts +++ b/client.ts @@ -7,10 +7,9 @@ import strftime from "./strftime.js"; export const maelink = new Maelink() export let token: string; export const connection = maelink.ws -console.debug('ass') maelink.ws.onopen = () => { - console.debug('open') + screen?.logs?.push('open') } export const home: any[] = []; @@ -19,7 +18,6 @@ let screen: Screen; export function setScreen(screenN: Screen) { screen = screenN - // console.log(screen) } interface Post { @@ -32,18 +30,14 @@ interface Post { } maelink.on('message', (e) => { - console.debug(e) screen.logs.push("INC: " + e) }) maelink.on("post", (post: Post) => { - console.debug('assss') - screen.logs.push("POST: " + JSON.stringify(post)) + screen.logs.push("MESSAGE: " + JSON.stringify(post)) home.push(post); - console.debug(post, 'uh', home) const textHome: string[] = home.map(p => `[${strftime("%H:%M:%S", new Date(Number(JSON.parse(p.e).t) * 1000))}] ${p.u}: ${p.p}`); const homeElem: Text = screen.elements.get("home") as Text; - console.debug(homeElem, screen) if(homeElem) homeElem.text = textHome.join("\n")+"\n"; screen.render() }) diff --git a/screen.ts b/screen.ts index 69e3e1d..a623ddf 100644 --- a/screen.ts +++ b/screen.ts @@ -10,7 +10,7 @@ import process from "node:process"; const logs: string[] = []; function onexit() { - // console.clear() + console.clear() console.log("\nQuitting meower CL") for (const log of logs) { console.log(log) @@ -39,7 +39,6 @@ export class Screen { handleKeypress(_chunk: Buffer, key: Key, screen: Screen) { const focusableIDs = Object.keys(screen.getFocusable()); const focusedIndex = focusableIDs.indexOf(screen.focusedElementId); - // console.debug(this.client.ws.readyState) if (key && key.name == 'escape' || key.name == "c" && key.ctrl) { onexit(); Deno.exit(0); @@ -84,8 +83,6 @@ export class Screen { } render() { - // console.debug('render') - // return; console.clear() process.stdout.write("\u001b[2J") // use an ansi escape code to clear the screen if console.clear doesn't clear fully this.elements.forEach(element => { |