fix: tab deleting side effect
This commit is contained in:
committed by
Andrew Bastin
parent
7ea482b7ed
commit
bc4d8126f1
@@ -115,10 +115,7 @@ const updateSelectedTeam = (team: TeamData | undefined) => {
|
|||||||
emit("update-selected-team", team)
|
emit("update-selected-team", team)
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(selectedCollectionTab, (newValue: string) => {
|
||||||
() => selectedCollectionTab.value,
|
|
||||||
(newValue: string) => {
|
|
||||||
updateCollectionsType(newValue)
|
updateCollectionsType(newValue)
|
||||||
}
|
})
|
||||||
)
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -337,6 +337,9 @@ export default defineComponent({
|
|||||||
"collectionsType.selectedTeam"(value) {
|
"collectionsType.selectedTeam"(value) {
|
||||||
if (value?.id) this.teamCollectionAdapter.changeTeamID(value.id)
|
if (value?.id) this.teamCollectionAdapter.changeTeamID(value.id)
|
||||||
},
|
},
|
||||||
|
currentUser(newValue) {
|
||||||
|
if (!newValue) this.updateCollectionType("my-collections")
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.subscribeTo(this.teamCollectionAdapter.collections$, (colls) => {
|
this.subscribeTo(this.teamCollectionAdapter.collections$, (colls) => {
|
||||||
|
|||||||
@@ -129,6 +129,10 @@ const removeTabEntry = (tabID: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tabEntries.value.splice(index, 1)
|
tabEntries.value.splice(index, 1)
|
||||||
|
|
||||||
|
// If we tried to remove the active tabEntries, switch to first tab entry
|
||||||
|
if (props.value === tabID)
|
||||||
|
if (tabEntries.value.length > 0) selectTab(tabEntries.value[0][0])
|
||||||
}
|
}
|
||||||
|
|
||||||
provide<TabProvider>("tabs-system", {
|
provide<TabProvider>("tabs-system", {
|
||||||
|
|||||||
Reference in New Issue
Block a user