fix(tui): show toast when variant_list keybind used with no variants (#30724)
This commit is contained in:
@@ -715,6 +715,13 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
|
|||||||
hidden: local.model.variant.list().length === 0,
|
hidden: local.model.variant.list().length === 0,
|
||||||
slashName: "variants",
|
slashName: "variants",
|
||||||
run: () => {
|
run: () => {
|
||||||
|
if (local.model.variant.list().length === 0) {
|
||||||
|
return toast.show({
|
||||||
|
title: "No variants available",
|
||||||
|
message: "The current model does not support any variants.",
|
||||||
|
variant: "info",
|
||||||
|
})
|
||||||
|
}
|
||||||
dialog.replace(() => <DialogVariant />)
|
dialog.replace(() => <DialogVariant />)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user