diff --git a/web-common/src/features/connectors/olap/DatabaseExplorer.svelte b/web-common/src/features/connectors/olap/DatabaseExplorer.svelte index 016921767a0..29f5e2b017b 100644 --- a/web-common/src/features/connectors/olap/DatabaseExplorer.svelte +++ b/web-common/src/features/connectors/olap/DatabaseExplorer.svelte @@ -8,33 +8,30 @@ export let instanceId: string; export let connector: V1AnalyzedConnector; - let dataBasesQuery: ReturnType; - $: if (connector.name) { - dataBasesQuery = useDatabases(instanceId, connector?.name); - } + $: connectorName = connector?.name as string; + + $: dataBasesQuery = useDatabases(instanceId, connectorName); $: ({ data, error, isLoading } = $dataBasesQuery); -{#if connector && connector.name} -
- {#if error} - Error: {error.response.data.message} - {:else if isLoading} - Loading databases... - {:else if data} - {#if data.length === 0} - No databases found - {:else} -
    - {#each data as database (database)} - - {/each} -
- {/if} +
+ {#if error} + Error: {error.response.data.message} + {:else if isLoading} + Loading databases... + {:else if data} + {#if data.length === 0} + No databases found + {:else} +
    + {#each data as database (database)} + + {/each} +
{/if} -
-{/if} + {/if} +