aboutsummaryrefslogtreecommitdiff
path: root/src/components/settings_modal/settings_modal_content.js
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2020-09-08 09:46:19 +0000
committerShpuld Shpludson <shp@cock.li>2020-09-08 09:46:19 +0000
commit938887ef91a12dcaaaaa0884af4e76abd1c6c679 (patch)
tree14d913a145a4e7bcb9221a38aea70410293ce69f /src/components/settings_modal/settings_modal_content.js
parente768ec1fca2f7580d111b0878a9695b0c8b9dbb1 (diff)
parentf31bc5310e544cd6f960471659c5a83e1f1721be (diff)
Merge branch 'rc/2.1.1' into 'master'
Update master with 2.1.1 See merge request pleroma/pleroma-fe!1231
Diffstat (limited to 'src/components/settings_modal/settings_modal_content.js')
-rw-r--r--src/components/settings_modal/settings_modal_content.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/components/settings_modal/settings_modal_content.js b/src/components/settings_modal/settings_modal_content.js
index 48101a90..ef1a5ffa 100644
--- a/src/components/settings_modal/settings_modal_content.js
+++ b/src/components/settings_modal/settings_modal_content.js
@@ -27,6 +27,34 @@ const SettingsModalContent = {
computed: {
isLoggedIn () {
return !!this.$store.state.users.currentUser
+ },
+ open () {
+ return this.$store.state.interface.settingsModalState !== 'hidden'
+ }
+ },
+ methods: {
+ onOpen () {
+ 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 => {
+ return elm.data && elm.data.attrs['data-tab-name'] === targetTab
+ })
+ if (tabIndex >= 0) {
+ this.$refs.tabSwitcher.setTab(tabIndex)
+ }
+ }
+ // Clear the state of target tab, so that next time settings is opened
+ // it doesn't force it.
+ this.$store.dispatch('clearSettingsModalTargetTab')
+ }
+ },
+ mounted () {
+ this.onOpen()
+ },
+ watch: {
+ open: function (value) {
+ if (value) this.onOpen()
}
}
}