|
|
@@ -4,11 +4,11 @@ import { Tips } from "./tips-view"
|
|
|
|
|
|
const id = "internal:home-tips"
|
|
|
|
|
|
-function View(props: { show: boolean }) {
|
|
|
+function View(props: { show: boolean; connected: boolean }) {
|
|
|
return (
|
|
|
<box height={4} minHeight={0} width="100%" maxWidth={75} alignItems="center" paddingTop={3} flexShrink={1}>
|
|
|
<Show when={props.show}>
|
|
|
- <Tips />
|
|
|
+ <Tips connected={props.connected} />
|
|
|
</Show>
|
|
|
</box>
|
|
|
)
|
|
|
@@ -35,8 +35,13 @@ const tui: TuiPlugin = async (api) => {
|
|
|
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()} />
|
|
|
+ const connected = createMemo(() =>
|
|
|
+ api.state.provider.some(
|
|
|
+ (item) => item.id !== "opencode" || Object.values(item.models).some((model) => model.cost?.input !== 0),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ const show = createMemo(() => (!first() || !connected()) && !hidden())
|
|
|
+ return <View show={show()} connected={connected()} />
|
|
|
},
|
|
|
},
|
|
|
})
|