Skip to content

Commit

Permalink
fix(ui): prevent welcome redirection (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skraye authored May 10, 2023
1 parent 844823a commit 74d8e82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
};
},
computed: {
...mapState("auth", ["user"]),
...mapState("core", ["message", "error"]),
...mapGetters("core", ["guidedProperties"]),
...mapState("flow", ["overallTotal"]),
Expand Down Expand Up @@ -97,7 +98,6 @@
initGuidedTour() {
this.$store.dispatch("flow/findFlows", {limit: 1})
.then(flows => {
this.$store.commit("flow/setOverallTotal", flows.total);
if (flows.total === 0 && this.$route.name === "home") {
this.$router.push({name: "welcome"});
}
Expand All @@ -106,7 +106,7 @@
},
watch: {
$route(to) {
if (to.name === "home" && this.overallTotal === 0) {
if (this.user && to.name === "home" && this.overallTotal === 0) {
this.$router.push({name: "welcome"});
}
}
Expand Down
2 changes: 2 additions & 0 deletions ui/src/stores/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default {
}).then(response => {
commit("setFlows", response.data.results)
commit("setTotal", response.data.total)
commit("setOverallTotal", response.data.total)

return response.data;
})
Expand Down Expand Up @@ -70,6 +71,7 @@ export default {
commit("setFlow", response.data);
}

commit("setOverallTotal", 1)
return response.data;
})
},
Expand Down

0 comments on commit 74d8e82

Please sign in to comment.