Skip to content

Commit

Permalink
fix: preserve last visited tab not working in mobile view
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Oct 1, 2024
1 parent 1fb5347 commit 8a65602
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/pages/Deal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</template>
</LayoutHeader>
<div v-if="deal.data" class="flex h-full overflow-hidden">
<Tabs v-model="tabIndex" v-slot="{ tab }" :tabs="tabs">
<Tabs v-model="tabIndex" :tabs="tabs">
<Activities
ref="activities"
doctype="CRM Deal"
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/pages/MobileDeal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
<Activities
v-else
doctype="CRM Deal"
:title="tab.name"
:tabs="tabs"
v-model:reload="reload"
v-model:tabIndex="tabIndex"
v-model="deal"
Expand Down Expand Up @@ -278,6 +278,7 @@ import {
callEnabled,
isMobileView,
} from '@/composables/settings'
import { useActiveTabManager } from '@/composables/useActiveTabManager'
import {
createResource,
Dropdown,
Expand Down Expand Up @@ -427,7 +428,6 @@ const breadcrumbs = computed(() => {
return items
})
const tabIndex = ref(0)
const tabs = computed(() => {
let tabOptions = [
{
Expand Down Expand Up @@ -476,6 +476,7 @@ const tabs = computed(() => {
]
return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true))
})
const { tabIndex } = useActiveTabManager(tabs, 'lastDealTab')
const fieldsLayout = createResource({
url: 'crm.api.doc.get_sidebar_fields',
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/pages/MobileLead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
<Activities
v-else
doctype="CRM Lead"
:title="tab.name"
:tabs="tabs"
v-model:reload="reload"
v-model:tabIndex="tabIndex"
Expand Down Expand Up @@ -203,6 +202,7 @@ import {
callEnabled,
isMobileView,
} from '@/composables/settings'
import { useActiveTabManager } from '@/composables/useActiveTabManager'
import {
createResource,
Dropdown,
Expand Down Expand Up @@ -338,8 +338,6 @@ const breadcrumbs = computed(() => {
return items
})
const tabIndex = ref(0)
const tabs = computed(() => {
let tabOptions = [
{
Expand Down Expand Up @@ -388,6 +386,7 @@ const tabs = computed(() => {
]
return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true))
})
const { tabIndex } = useActiveTabManager(tabs, 'lastLeadTab')
watch(tabs, (value) => {
if (value && route.params.tabName) {
Expand Down

0 comments on commit 8a65602

Please sign in to comment.