logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 0671aa0dd0cd199dc6206ae8b3fb0de114acddfe
parent b62653c202d35ebcc5cd56d87c049405d6d500cd
Author: Henry Jameson <me@hjkos.com>
Date:   Thu, 17 Mar 2022 08:47:11 +0200

fix tabswitcher

Diffstat:

Msrc/components/settings_modal/settings_modal_content.js2+-
Msrc/components/tab_switcher/tab_switcher.jsx6+++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/components/settings_modal/settings_modal_content.js b/src/components/settings_modal/settings_modal_content.js @@ -63,7 +63,7 @@ const SettingsModalContent = { const targetTab = this.$store.state.interface.settingsModalTargetTab // We're being told to open in specific tab if (targetTab) { - const tabIndex = this.$refs.tabSwitcher.$slots.default().findIndex(elm => { + const tabIndex = this.$refs.tabSwitcher.$slots.default.findIndex(elm => { return elm.data && elm.data.attrs['data-tab-name'] === targetTab }) if (tabIndex >= 0) { diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.jsx @@ -43,14 +43,14 @@ export default { }, data () { return { - active: findFirstUsable(this.$slots.default()) + active: findFirstUsable(this.$slots.default) } }, computed: { activeIndex () { // In case of controlled component if (this.activeTab) { - return this.$slots.default().findIndex(slot => this.activeTab === slot.key) + return this.$slots.default.findIndex(slot => this.activeTab === slot.key) } else { return this.active } @@ -74,7 +74,7 @@ export default { }, // DO NOT put it to computed, it doesn't work (caching?) slots () { - return this.$slots.default() + return this.$slots.default }, setTab (index) { if (typeof this.onSwitch === 'function') {