Skip to content

Commit

Permalink
furhter nits
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Oct 29, 2024
1 parent d743e00 commit 65551fc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions frontend/src/lib/components/FlowBuilder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
}
} catch (err) {
console.error('Error comparing versions', err)
onLatest = false
onLatest = true
}
}
Expand Down Expand Up @@ -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 {
Expand Down
30 changes: 17 additions & 13 deletions frontend/src/lib/components/apps/editor/AppEditorHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -764,7 +768,7 @@
}
// deployedValue should be syncronized when we open Diff
await syncWithDeployed();
await syncWithDeployed()
diffDrawer?.openDrawer()
diffDrawer?.setDiff({
Expand Down Expand Up @@ -955,7 +959,7 @@
return
}
// deployedValue should be syncronized when we open Diff
await syncWithDeployed();
await syncWithDeployed()

saveDrawerOpen = false
diffDrawer?.openDrawer()
Expand Down

0 comments on commit 65551fc

Please sign in to comment.