fix outside js owner
This commit is contained in:
@@ -15,19 +15,15 @@ function View(props: { show: boolean }) {
|
||||
}
|
||||
|
||||
const tui: TuiPlugin = async (api) => {
|
||||
const hidden = createMemo(() => api.kv.get("tips_hidden", false))
|
||||
const first = createMemo(() => api.state.session.count() === 0)
|
||||
const show = createMemo(() => !first() && !hidden())
|
||||
|
||||
api.command.register(() => [
|
||||
{
|
||||
title: hidden() ? "Show tips" : "Hide tips",
|
||||
title: api.kv.get("tips_hidden", false) ? "Show tips" : "Hide tips",
|
||||
value: "tips.toggle",
|
||||
keybind: "tips_toggle",
|
||||
category: "System",
|
||||
hidden: api.route.current.name !== "home",
|
||||
onSelect() {
|
||||
api.kv.set("tips_hidden", !hidden())
|
||||
api.kv.set("tips_hidden", !api.kv.get("tips_hidden", false))
|
||||
api.ui.dialog.clear()
|
||||
},
|
||||
},
|
||||
@@ -37,6 +33,9 @@ const tui: TuiPlugin = async (api) => {
|
||||
order: 100,
|
||||
slots: {
|
||||
home_bottom() {
|
||||
const hidden = createMemo(() => api.kv.get("tips_hidden", false))
|
||||
const first = createMemo(() => api.state.session.count() === 0)
|
||||
const show = createMemo(() => !first() && !hidden())
|
||||
return <View show={show()} />
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user