furhter nits

This commit is contained in:
Ruben Fiszel
2024-10-29 08:09:48 +01:00
parent b31f62940c
commit e76c565d70
2 changed files with 19 additions and 15 deletions
@@ -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 {
@@ -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()