diff --git a/frontend/src/lib/components/FlowBuilder.svelte b/frontend/src/lib/components/FlowBuilder.svelte index 63e1655a77812..b04fbdf8dcfae 100644 --- a/frontend/src/lib/components/FlowBuilder.svelte +++ b/frontend/src/lib/components/FlowBuilder.svelte @@ -132,7 +132,7 @@ } } catch (err) { console.error('Error comparing versions', err) - onLatest = false + onLatest = true } } @@ -286,7 +286,7 @@ async function handleSaveFlow(deploymentMsg?: string) { await compareVersions() - if (onLatest || initialPath == '') { + if (onLatest || initialPath == '' || savedFlow?.draft_only) { // Handle directly await saveFlow(deploymentMsg) } else { diff --git a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte index e3eb07b3725c9..af2f4563df2cc 100644 --- a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte @@ -368,18 +368,17 @@ } async function handleUpdateApp(npath: string) { - // We have to make sure there is no updates when we clicked the button - await compareVersions(); + await compareVersions() if (onLatest) { // Handle directly await updateApp(npath) } else { - // There is onLatest, but we need more information while deploying - // We need it to show diff + // There is onLatest, but we need more information while deploying + // We need it to show diff // Handle through confirmation modal - await syncWithDeployed(); + await syncWithDeployed() confirmCallback = async () => { open = false @@ -628,13 +627,18 @@ if (version === undefined) { return } - const appVersion = await AppService.getAppLatestVersion({ - workspace: $workspaceStore!, - path: appPath - }) - onLatest = version === appVersion?.version - + try { + const appVersion = await AppService.getAppLatestVersion({ + workspace: $workspaceStore!, + path: appPath + }) + onLatest = version === appVersion?.version + } catch (e) { + console.error('Error comparing versions', e) + onLatest = true + } } + $: saveDrawerOpen && compareVersions() let selectedJobId: string | undefined = undefined @@ -764,7 +768,7 @@ } // deployedValue should be syncronized when we open Diff - await syncWithDeployed(); + await syncWithDeployed() diffDrawer?.openDrawer() diffDrawer?.setDiff({ @@ -955,7 +959,7 @@ return } // deployedValue should be syncronized when we open Diff - await syncWithDeployed(); + await syncWithDeployed() saveDrawerOpen = false diffDrawer?.openDrawer()