Created
December 16, 2023 16:22
-
-
Save johnlindquist/07f97cd383b1a81f1fb0e76507b81eb2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Shortcuts Condition | |
import "@johnlindquist/kit" | |
let value = await arg( | |
{ | |
placeholder: `Type "one`, | |
shortcuts: [ | |
{ | |
name: "one", | |
key: `${cmd}+1`, | |
condition: choice => { | |
return choice?.value === "One" | |
}, | |
onPress: async () => { | |
submit("You win!") | |
}, | |
visible: true, | |
bar: "right", | |
}, | |
], | |
}, | |
["One", "Two", "Three"] | |
) | |
await editor(value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment