mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
Inline toggle logic, remove helpers
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
This commit is contained in:
parent
f0db731585
commit
ea28b345a2
1 changed files with 1 additions and 14 deletions
|
|
@ -40,23 +40,10 @@ export function Home() {
|
|||
return !tipsHidden()
|
||||
})
|
||||
|
||||
function hideTips() {
|
||||
kv.set("tips_hidden", true)
|
||||
}
|
||||
|
||||
function enableTips() {
|
||||
kv.set("tips_hidden", false)
|
||||
}
|
||||
|
||||
useKeyboard((evt) => {
|
||||
// Don't handle tips keybind for first-time users
|
||||
if (isFirstTimeUser()) return
|
||||
if (evt.name === "h" && evt.ctrl && !evt.meta && !evt.shift) {
|
||||
if (showTips()) {
|
||||
hideTips()
|
||||
} else {
|
||||
enableTips()
|
||||
}
|
||||
kv.set("tips_hidden", !tipsHidden())
|
||||
evt.preventDefault()
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue