Skip to content

Commit

Permalink
fix(menus): isStart function not called on classed based menus
Browse files Browse the repository at this point in the history
  • Loading branch information
ephrimlawrence committed Mar 19, 2024
1 parent 74d53e4 commit 2cc1321
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/menus/base.menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ export abstract class BaseMenu {
return true;
}

async paginate(): Promise<boolean> {
paginate(): Promise<boolean> | boolean {
return false;
}

abstract message(): Promise<string>;
abstract message(): Promise<string> | string;

abstract nextMenu(): Promise<string | undefined>;
abstract nextMenu(): Promise<string | undefined> | string | undefined;

/**
* Terminate the current session
*
*/
async end(): Promise<boolean> {
end(): Promise<boolean> | boolean {
return false;
}

Expand All @@ -34,8 +34,8 @@ export abstract class BaseMenu {
return this.request.query?.sessionid!;
}

async isStart(): Promise<boolean> {
return Promise.resolve(false);
isStart(): Promise<boolean> | boolean {
return false
}

get session(): Session {
Expand Down
2 changes: 1 addition & 1 deletion src/menus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit 2cc1321

Please sign in to comment.