diff options
| author | Maksim Pechnikov <parallel588@gmail.com> | 2020-09-07 09:47:17 +0300 |
|---|---|---|
| committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-09-07 09:47:17 +0300 |
| commit | fa2b680855c790ba8ed8d7cc0dbf2a3a2e1dbaf6 (patch) | |
| tree | b2868a1c0d2fce025134af4167c824fc8ee49068 /src/components/settings_modal/settings_modal_content.js | |
| parent | 12519a54b55140a3e5f76e67ac53914654c2a8b0 (diff) | |
| parent | a73b09c73202117ffa3fecf7a9185981d6696912 (diff) | |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma-fe into develop
Diffstat (limited to 'src/components/settings_modal/settings_modal_content.js')
| -rw-r--r-- | src/components/settings_modal/settings_modal_content.js | 28 |
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() } } } |
