From 6bfc7f6d3b9aa6c73fa008fe90ddb4fec65525e8 Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Mon, 18 May 2020 19:58:41 +0200 Subject: [PATCH] fix(toggle): hide keyboard button when hidden fixes #94 --- source/menu-template.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/menu-template.ts b/source/menu-template.ts index c0f3560..fc0b910 100644 --- a/source/menu-template.ts +++ b/source/menu-template.ts @@ -257,7 +257,11 @@ export class MenuTemplate { options.hide ) - this._keyboard.add(Boolean(options.joinLastRow), async (context, path): Promise => { + this._keyboard.add(Boolean(options.joinLastRow), async (context, path): Promise => { + if (options.hide && await options.hide(context)) { + return undefined + } + const isSet = await options.isSet(context) return { text: await prefixEmoji(text, isSet, options, context, path),