diff --git a/changelog.d/third_column.fix b/changelog.d/third_column.fix new file mode 100644 index 000000000..191e914d5 --- /dev/null +++ b/changelog.d/third_column.fix @@ -0,0 +1 @@ +Fixed layout selector (third column/reverse) not working immideately upon change diff --git a/src/App.js b/src/App.js index 4ce6f1abc..d7a63bd8a 100644 --- a/src/App.js +++ b/src/App.js @@ -74,6 +74,8 @@ export default { }, data: () => ({ mobileActivePanel: 'timeline', + updateMobileState: null, + updateScrollState: null, }), provide() { return { @@ -211,31 +213,32 @@ export default { hideShoutbox() { return this.isChats || useMergedConfigStore().mergedConfig.hideShoutbox }, + thirdColumnMode() { + return this.mergedConfig.thirdColumnMode + }, + reverseSetting() { + return this.mergedConfig.sidebarRight + }, reverseLayout() { - const { thirdColumnMode, sidebarRight: reverseSetting } = - useMergedConfigStore().mergedConfig if (this.layoutType !== 'wide') { - return reverseSetting + return this.reverseSetting } else { - return thirdColumnMode === 'notifications' - ? reverseSetting - : !reverseSetting + return this.thirdColumnMode === 'notifications' + ? this.reverseSetting + : !this.reverseSetting } }, noSticky() { - return useMergedConfigStore().mergedConfig.disableStickyHeaders + return this.mergedConfig.disableStickyHeaders }, showScrollbars() { - return useMergedConfigStore().mergedConfig.showScrollbars + return this.mergedConfig.showScrollbars }, scrollParent() { return window /* this.$refs.appContentRef */ }, showInstanceSpecificPanel() { - return ( - this.instanceSpecificPanelPresent && - !useMergedConfigStore().mergedConfig.hideISP - ) + return this.instanceSpecificPanelPresent && !this.mergedConfig.hideISP }, ...mapState(useMergedConfigStore, ['mergedConfig']), ...mapState(useInterfaceStore, [ diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 393aef639..feb59857e 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -134,12 +134,11 @@ const Notifications = { return this.minimalMode || layoutType === 'mobile' }, teleportTarget() { - const { layoutType } = useInterfaceStore() const map = { wide: '#notifs-column', mobile: '#mobile-notifications', } - return map[layoutType] || '#notifs-sidebar' + return map[this.layoutType] || '#notifs-sidebar' }, popoversZLayer() { const { layoutType } = useInterfaceStore() @@ -162,6 +161,7 @@ const Notifications = { }, ...mapState(useAnnouncementsStore, ['unreadAnnouncementCount']), ...mapState(useChatsStore, ['unreadChatsCount']), + ...mapState(useInterfaceStore, ['layoutType']), }, mounted() { this.scrollerRef = this.$refs.root.closest('.column.-scrollable') diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index 09d3ecc2d..a1a946fca 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -113,6 +113,7 @@ export default { localDraft: null, } }, + emits: ['update:modelValue'], created() { if ( this.realDraftMode && @@ -244,7 +245,9 @@ export default { }, configSink() { if (this.path == null) { - return (k, v) => this.$emit('update:modelValue', v) + return () => { + /* no-op */ + } } switch (this.realSource) { @@ -385,11 +388,13 @@ export default { if (this.realDraftMode) { this.draft = this.getValue(e) } else { + this.$emit('update:modelValue', this.getValue(e)) this.configSink(this.path, this.getValue(e)) } }, commitDraft() { if (this.realDraftMode) { + this.$emit('update:modelValue', this.draft) this.configSink(this.path, this.draft) } }, diff --git a/src/components/settings_modal/tabs/layout_tab.js b/src/components/settings_modal/tabs/layout_tab.js index fc56e1392..50761fa43 100644 --- a/src/components/settings_modal/tabs/layout_tab.js +++ b/src/components/settings_modal/tabs/layout_tab.js @@ -6,6 +6,7 @@ import SharedComputedObject from '../helpers/shared_computed_object.js' import UnitSetting from '../helpers/unit_setting.vue' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' +import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' const GeneralTab = { @@ -46,6 +47,11 @@ const GeneralTab = { }, ...SharedComputedObject(), }, + methods: { + updateLayout() { + useInterfaceStore().setLayoutWidth() + }, + }, } export default GeneralTab diff --git a/src/components/settings_modal/tabs/layout_tab.vue b/src/components/settings_modal/tabs/layout_tab.vue index 0035f3a11..b649572fb 100644 --- a/src/components/settings_modal/tabs/layout_tab.vue +++ b/src/components/settings_modal/tabs/layout_tab.vue @@ -105,6 +105,7 @@ id="thirdColumnMode" path="thirdColumnMode" :options="thirdColumnModeOptions" + @change="updateLayout" > {{ $t('settings.third_column_mode') }}