From 5decc03307b002b1a8c7f68b1a3e77716e75ac8a Mon Sep 17 00:00:00 2001 From: Rihan Date: Mon, 28 Oct 2024 05:59:41 +0000 Subject: [PATCH] fix: only show vectorize as remote storage if indexes present (#352) --- src/features.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/features.ts b/src/features.ts index fd09dbb2..dd991ceb 100644 --- a/src/features.ts +++ b/src/features.ts @@ -356,10 +356,16 @@ export async function setupRemote(_nuxt: Nuxt, hub: HubConfig) { } }) - const availableStorages = Object.keys(remoteManifest?.storage || {}).filter(k => hub[k as keyof typeof hub] && remoteManifest?.storage[k]) + const availableStorages = Object.keys(remoteManifest?.storage || {}).filter((k) => { + if (k === 'vectorize') { + return Object.keys(hub.vectorize ?? {}).length && Object.keys(remoteManifest!.storage.vectorize!).length + } + return hub[k as keyof typeof hub] && remoteManifest?.storage[k] + }) + if (availableStorages.length > 0) { const storageDescriptions = availableStorages.map((storage) => { - if (storage === 'vectorize' && Object.keys(hub.vectorize || {}).length) { + if (storage === 'vectorize') { const indexes = Object.keys(remoteManifest!.storage.vectorize!).join(', ') return `\`${storage} (${indexes})\`` }