fix: conditionally render servers in dash command

This commit is contained in:
hamster1963 2025-01-25 19:46:06 +08:00
parent ce94204efd
commit d302df895a

View File

@ -71,6 +71,8 @@ export function DashCommand() {
<CommandInput placeholder={t("TypeCommand")} value={search} onValueChange={setSearch} />
<CommandList>
<CommandEmpty>{t("NoResults")}</CommandEmpty>
{nezhaWsData.servers.length > 0 && (
<>
<CommandGroup heading={t("Servers")}>
{nezhaWsData.servers.map((server) => (
<CommandItem
@ -90,6 +92,8 @@ export function DashCommand() {
</CommandItem>
))}
</CommandGroup>
</>
)}
<CommandSeparator />
<CommandGroup heading={t("Shortcuts")}>