Skip to content

Commit

Permalink
fix(select): setFunc and hide key argument are now the last match group
Browse files Browse the repository at this point in the history
this requires you to get the rest of the options via the ctx.match but 
handles backwards compability.
also its nice to have it for simpler menus
  • Loading branch information
EdJoPaTo committed Sep 20, 2018
1 parent 493906a commit 9d1d736
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inline-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class TelegrafInlineMenu {
throw new Error('setFunc and submenu can not be set at the same time.')
}

const keyFromCtx = ctx => ctx.match[1]
const keyFromCtx = ctx => ctx.match[ctx.match.length - 1]
const hideSelectAction = hide && (ctx => hide(ctx, keyFromCtx(ctx)))

const handler = {
Expand Down

0 comments on commit 9d1d736

Please sign in to comment.