Skip to content

Commit

Permalink
fix(toggle): hide keyboard button when hidden
Browse files Browse the repository at this point in the history
fixes #94
  • Loading branch information
EdJoPaTo committed May 18, 2020
1 parent 58da393 commit 6bfc7f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/menu-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ export class MenuTemplate<Context> {
options.hide
)

this._keyboard.add(Boolean(options.joinLastRow), async (context, path): Promise<CallbackButtonTemplate> => {
this._keyboard.add(Boolean(options.joinLastRow), async (context, path): Promise<CallbackButtonTemplate | undefined> => {
if (options.hide && await options.hide(context)) {
return undefined
}

const isSet = await options.isSet(context)
return {
text: await prefixEmoji(text, isSet, options, context, path),
Expand Down

0 comments on commit 6bfc7f6

Please sign in to comment.