fix: tab switching side effect

This commit is contained in:
liyasthomas
2022-03-24 19:59:59 +05:30
committed by Andrew Bastin
parent a03f31a526
commit 7ea482b7ed
2 changed files with 62 additions and 72 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div v-if="show">
<SmartTabs :id="'collections_tab'" v-model="collectionTab">
<SmartTabs :id="'collections_tab'" v-model="selectedCollectionTab">
<SmartTab
:id="'my-collections'"
:label="`${$t('collection.my_collections')}`"
@@ -75,7 +75,7 @@ type TeamData = GetMyTeamsQuery["myTeams"][number]
type CollectionTabs = "my-collections" | "team-collections"
const collectionTab = ref<CollectionTabs>("my-collections")
const selectedCollectionTab = ref<CollectionTabs>("my-collections")
defineProps<{
doc: boolean
@@ -116,7 +116,7 @@ const updateSelectedTeam = (team: TeamData | undefined) => {
}
watch(
() => collectionTab.value,
() => selectedCollectionTab.value,
(newValue: string) => {
updateCollectionsType(newValue)
}