main loop

This commit is contained in:
Ben 2025-02-25 15:25:14 +01:00
parent b1e49eef87
commit 2297d01966
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B

View File

@ -1,12 +1,21 @@
export class MainMenu {
constructor(uiService) {
this.ui = uiService;
this.running = true;
}
show = async () => {
this.ui.showLogo();
this.ui.showInfoMessage("hello");
while (this.running) {
await this.promptMainMenu();
}
this.ui.showInfoMessage("K-THX-BYE");
};
promptMainMenu = async() => {
await this.ui.askMultipleChoice("Select an option",[
{
label: "optionOne",
@ -15,10 +24,13 @@ export class MainMenu {
}
},{
label: "optionTwo",
action: async function() {
console.log("B!")
}
action: this.closeMainMenu
},
])
};
closeMainMenu = async() => {
console.log("B!")
this.running = false;
};
}