From 2cc13212210fbc0e2c51be32cbc7ad485ca4516a Mon Sep 17 00:00:00 2001 From: Lawrence Ephrim Date: Tue, 19 Mar 2024 06:29:08 +0000 Subject: [PATCH] fix(menus): `isStart` function not called on classed based menus --- src/menus/base.menu.ts | 12 ++++++------ src/menus/index.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/menus/base.menu.ts b/src/menus/base.menu.ts index 128b3ac..dd75532 100644 --- a/src/menus/base.menu.ts +++ b/src/menus/base.menu.ts @@ -13,19 +13,19 @@ export abstract class BaseMenu { return true; } - async paginate(): Promise { + paginate(): Promise | boolean { return false; } - abstract message(): Promise; + abstract message(): Promise | string; - abstract nextMenu(): Promise; + abstract nextMenu(): Promise | string | undefined; /** * Terminate the current session * */ - async end(): Promise { + end(): Promise | boolean { return false; } @@ -34,8 +34,8 @@ export abstract class BaseMenu { return this.request.query?.sessionid!; } - async isStart(): Promise { - return Promise.resolve(false); + isStart(): Promise | boolean { + return false } get session(): Session { diff --git a/src/menus/index.ts b/src/menus/index.ts index cae5867..203a165 100644 --- a/src/menus/index.ts +++ b/src/menus/index.ts @@ -55,7 +55,7 @@ export class Menus { isStart = await menu.isStart() } else { // @ts-ignore - isStart = (await new menu(req, res).isStart) + isStart = (await new menu(req, res).isStart()) } } else {