Skip to content

Commit

Permalink
fix: route to home after setup
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Dec 7, 2023
1 parent 0296329 commit 9c76bb4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/setup/Setup.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script setup>
import settings from '@/stores/settingsStore'
import settingsStore from '@/stores/settingsStore'
import { computed, markRaw, provide, reactive, ref } from 'vue'
import SetupQuestions from './SetupQuestions.vue'
import SourceConnectionStep from './SourceConnectionStep.vue'
import SourceTypeStep from './SourceTypeStep.vue'
import { useRouter } from 'vue-router'
const setupState = reactive({
sourceType: null, // 'erpnext', 'mariadb', 'postgresql', 'file', 'sample'
Expand Down Expand Up @@ -58,10 +59,14 @@ const steps = ref([
])
const currentStep = ref(0)
const settings = settingsStore()
const router = useRouter()
async function handleNext() {
if (currentStep.value === steps.value.length - 1) {
settings.settings.setup_complete = 1
await settings.update({ setup_complete: 1 }, false)
window.location.reload()
router.push({ path: '/' })
return
}
currentStep.value += 1
}
Expand Down

0 comments on commit 9c76bb4

Please sign in to comment.