Skip to content
Snippets Groups Projects
Commit 5a0bb29f authored by Dave LiPuma's avatar Dave LiPuma
Browse files

#417: reset tab from the outside

parent 3d30ad1d
Branches
No related tags found
No related merge requests found
......@@ -4,19 +4,12 @@ import './tab_switcher.scss'
export default Vue.component('tab-switcher', {
name: 'TabSwitcher',
props: ['refresh', 'renderOnlyFocused'],
props: ['renderOnlyFocused'],
data () {
return {
active: this.$slots.default.findIndex(_ => _.tag)
}
},
watch: {
$route () {
if (this.refresh) {
this.active = 0
}
}
},
methods: {
activateTab (index) {
return () => {
......
......@@ -141,6 +141,9 @@ const UserProfile = {
}
this.cleanUp()
this.startUp()
},
$route () {
this.$refs.tabSwitcher.activateTab(0)()
}
},
components: {
......
......@@ -6,7 +6,7 @@
:switcher="true"
:selected="timeline.viewing"
/>
<tab-switcher :refresh="true" :renderOnlyFocused="true">
<tab-switcher :renderOnlyFocused="true" ref="tabSwitcher">
<Timeline
:label="$t('user_card.statuses')"
:disabled="!user.statuses_count"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment