From d724e704281bcd1c711bbdfbf3ea9aa728f24849 Mon Sep 17 00:00:00 2001 From: Eric P Green Date: Thu, 25 Apr 2024 18:05:23 -0700 Subject: [PATCH] Fix console error in Model Workspace --- .../(application)/[type=workspace]/[name]/+page.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web-local/src/routes/(application)/[type=workspace]/[name]/+page.svelte b/web-local/src/routes/(application)/[type=workspace]/[name]/+page.svelte index de61356c6c7..24036acd258 100644 --- a/web-local/src/routes/(application)/[type=workspace]/[name]/+page.svelte +++ b/web-local/src/routes/(application)/[type=workspace]/[name]/+page.svelte @@ -58,6 +58,7 @@ import { httpRequestQueue } from "@rilldata/web-common/runtime-client/http-client"; import { isProfilingQuery } from "@rilldata/web-common/runtime-client/query-matcher"; import { runtime } from "@rilldata/web-common/runtime-client/runtime-store"; + import type { CreateQueryResult } from "@tanstack/svelte-query"; import { getContext, onMount } from "svelte"; import { get, type Writable } from "svelte/store"; import { fade, slide } from "svelte/transition"; @@ -141,9 +142,11 @@ $: refreshedOn = resource?.state?.refreshedOn; $: resourceIsReconciling = resourceIsLoading($resourceQuery.data); - $: isLocalFileConnectorQuery = useIsLocalFileConnector(instanceId, filePath); - $: isLocalFileConnector = - type === "source" && !!$isLocalFileConnectorQuery.data; + let isLocalFileConnectorQuery: CreateQueryResult; + $: if (type === "source") { + isLocalFileConnectorQuery = useIsLocalFileConnector(instanceId, filePath); + } + $: isLocalFileConnector = !!$isLocalFileConnectorQuery?.data; $: selections = $queryHighlight?.map((selection) => ({ from: selection?.referenceIndex,