1
0
forked from test/crm

fix: route to leads when create first lead step is clicked

This commit is contained in:
Shariq Ansari 2025-03-12 16:03:26 +05:30
parent 472a93f22b
commit 6ab8d8ded1
2 changed files with 12 additions and 0 deletions

View File

@ -52,6 +52,7 @@
? 'text-ink-gray-5 line-through'
: 'text-ink-gray-8',
]"
@click="step.onClick"
>
<component :is="step.icon" class="h-4" />
<div class="text-base">{{ step.title }}</div>

View File

@ -6,8 +6,11 @@ import CommentIcon from '@/components/Icons/CommentIcon.vue'
import EmailIcon from '@/components/Icons/EmailIcon.vue'
import TaskIcon from '@/components/Icons/TaskIcon.vue'
import StepsIcon from '@/components/Icons/StepsIcon.vue'
import { useRouter } from 'vue-router'
import { ref, reactive, computed, markRaw } from 'vue'
let router
const minimize = ref(false)
const steps = reactive([
@ -16,6 +19,12 @@ const steps = reactive([
title: 'Create your first lead',
icon: markRaw(LeadsIcon),
completed: false,
onClick: () => {
if (steps[0].completed) return
minimize.value = true
router.push({ name: 'Leads' })
},
},
{
name: 'invite_your_team',
@ -71,6 +80,8 @@ const completedPercentage = computed(() =>
)
export function useOnboarding() {
router = useRouter()
function checkOnboardingStatus() {
let user = window.user
if (!user) return false