Skip to content

Commit 7e2406d

Browse files
authored
Nuxt3 fix automation after big merge (baserow#4721)
* Prevent the empty state * Fix loading spinner stuck
1 parent ca72db9 commit 7e2406d

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

web-frontend/modules/automation/components/sidebar/SidebarItemAutomation.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<li class="tree__sub" :class="{ active: workflow?._?.selected }">
2+
<li class="tree__sub" :class="{ active: workflow?._.selected }">
33
<a
44
class="tree__sub-link"
55
:title="workflow.name"
@@ -152,6 +152,9 @@ export default {
152152
})
153153
},
154154
async selectWorkflow(automation, workflow) {
155+
if (workflow?._.selected) {
156+
return
157+
}
155158
this.setLoading(automation, true)
156159
try {
157160
await this.$nuxt.$router.push({

web-frontend/modules/automation/pages/automationWorkflow.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,15 @@ onBeforeRouteUpdate((to, from) => {
323323
onRouteChange(from)
324324
})
325325
326+
const leavingRoute = ref(false)
326327
onBeforeRouteLeave((to, from) => {
327-
$store.dispatch('automationWorkflow/unselect')
328328
onRouteChange(from)
329+
leavingRoute.value = true
330+
})
331+
332+
onUnmounted(() => {
333+
if (leavingRoute.value) {
334+
$store.dispatch('automationWorkflow/unselect')
335+
}
329336
})
330337
</script>

web-frontend/modules/builder/components/sidebar/SidebarItemBuilder.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ export default {
146146
})
147147
},
148148
async selectPage(builder, page) {
149+
if (page._.selected) {
150+
return
151+
}
149152
this.setLoading(builder, true)
150153
try {
151154
await this.$nuxt.$router.push({

0 commit comments

Comments
 (0)