fix: store first lead & deal in local storage
This commit is contained in:
parent
698cf1a8cb
commit
c13ec48824
@ -296,16 +296,15 @@ function getIcon(routeName, icon) {
|
||||
// onboarding
|
||||
const { isOnboardingStepsCompleted, setUp } = useOnboarding('frappecrm')
|
||||
|
||||
const firstLead = ref('')
|
||||
const firstDeal = ref('')
|
||||
|
||||
async function getFirstLead() {
|
||||
if (firstLead.value) return firstLead.value
|
||||
let firstLead = localStorage.getItem('firstLead')
|
||||
if (firstLead) return firstLead
|
||||
return await call('crm.api.onboarding.get_first_lead')
|
||||
}
|
||||
|
||||
async function getFirstDeal() {
|
||||
if (firstDeal.value) return firstDeal.value
|
||||
let firstDeal = localStorage.getItem('firstDeal')
|
||||
if (firstDeal) return firstDeal
|
||||
return await call('crm.api.onboarding.get_first_deal')
|
||||
}
|
||||
|
||||
|
||||
@ -168,7 +168,9 @@ function createNewLead() {
|
||||
isLeadCreating.value = false
|
||||
show.value = false
|
||||
router.push({ name: 'Lead', params: { leadId: data.name } })
|
||||
updateOnboardingStep('create_first_lead')
|
||||
updateOnboardingStep('create_first_lead', true, false, () => {
|
||||
localStorage.setItem('firstLead', data.name)
|
||||
})
|
||||
},
|
||||
onError(err) {
|
||||
isLeadCreating.value = false
|
||||
|
||||
@ -657,7 +657,9 @@ async function convertToDeal() {
|
||||
existingOrganizationChecked.value = false
|
||||
existingContact.value = ''
|
||||
existingOrganization.value = ''
|
||||
updateOnboardingStep('convert_lead_to_deal')
|
||||
updateOnboardingStep('convert_lead_to_deal', true, false, () => {
|
||||
localStorage.setItem('firstDeal', _deal)
|
||||
})
|
||||
capture('convert_lead_to_deal')
|
||||
router.push({ name: 'Deal', params: { dealId: _deal } })
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user