fix third column setting change not affecting UI immideately
This commit is contained in:
parent
d23ec577a0
commit
d202b94104
5 changed files with 30 additions and 12 deletions
24
src/App.js
24
src/App.js
|
|
@ -74,6 +74,8 @@ export default {
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
mobileActivePanel: 'timeline',
|
mobileActivePanel: 'timeline',
|
||||||
|
updateMobileState: null,
|
||||||
|
updateScrollState: null,
|
||||||
}),
|
}),
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -211,22 +213,26 @@ export default {
|
||||||
hideShoutbox() {
|
hideShoutbox() {
|
||||||
return this.isChats || useMergedConfigStore().mergedConfig.hideShoutbox
|
return this.isChats || useMergedConfigStore().mergedConfig.hideShoutbox
|
||||||
},
|
},
|
||||||
|
thirdColumnMode() {
|
||||||
|
return this.mergedConfig.thirdColumnMode
|
||||||
|
},
|
||||||
|
reverseSetting() {
|
||||||
|
return this.mergedConfig.sidebarRight
|
||||||
|
},
|
||||||
reverseLayout() {
|
reverseLayout() {
|
||||||
const { thirdColumnMode, sidebarRight: reverseSetting } =
|
|
||||||
useMergedConfigStore().mergedConfig
|
|
||||||
if (this.layoutType !== 'wide') {
|
if (this.layoutType !== 'wide') {
|
||||||
return reverseSetting
|
return this.reverseSetting
|
||||||
} else {
|
} else {
|
||||||
return thirdColumnMode === 'notifications'
|
return this.thirdColumnMode === 'notifications'
|
||||||
? reverseSetting
|
? this.reverseSetting
|
||||||
: !reverseSetting
|
: !this.reverseSetting
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
noSticky() {
|
noSticky() {
|
||||||
return useMergedConfigStore().mergedConfig.disableStickyHeaders
|
return this.mergedConfig.disableStickyHeaders
|
||||||
},
|
},
|
||||||
showScrollbars() {
|
showScrollbars() {
|
||||||
return useMergedConfigStore().mergedConfig.showScrollbars
|
return this.mergedConfig.showScrollbars
|
||||||
},
|
},
|
||||||
scrollParent() {
|
scrollParent() {
|
||||||
return window /* this.$refs.appContentRef */
|
return window /* this.$refs.appContentRef */
|
||||||
|
|
@ -234,7 +240,7 @@ export default {
|
||||||
showInstanceSpecificPanel() {
|
showInstanceSpecificPanel() {
|
||||||
return (
|
return (
|
||||||
this.instanceSpecificPanelPresent &&
|
this.instanceSpecificPanelPresent &&
|
||||||
!useMergedConfigStore().mergedConfig.hideISP
|
!this.mergedConfig.hideISP
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
...mapState(useMergedConfigStore, ['mergedConfig']),
|
...mapState(useMergedConfigStore, ['mergedConfig']),
|
||||||
|
|
|
||||||
|
|
@ -134,12 +134,11 @@ const Notifications = {
|
||||||
return this.minimalMode || layoutType === 'mobile'
|
return this.minimalMode || layoutType === 'mobile'
|
||||||
},
|
},
|
||||||
teleportTarget() {
|
teleportTarget() {
|
||||||
const { layoutType } = useInterfaceStore()
|
|
||||||
const map = {
|
const map = {
|
||||||
wide: '#notifs-column',
|
wide: '#notifs-column',
|
||||||
mobile: '#mobile-notifications',
|
mobile: '#mobile-notifications',
|
||||||
}
|
}
|
||||||
return map[layoutType] || '#notifs-sidebar'
|
return map[this.layoutType] || '#notifs-sidebar'
|
||||||
},
|
},
|
||||||
popoversZLayer() {
|
popoversZLayer() {
|
||||||
const { layoutType } = useInterfaceStore()
|
const { layoutType } = useInterfaceStore()
|
||||||
|
|
@ -162,6 +161,9 @@ const Notifications = {
|
||||||
},
|
},
|
||||||
...mapState(useAnnouncementsStore, ['unreadAnnouncementCount']),
|
...mapState(useAnnouncementsStore, ['unreadAnnouncementCount']),
|
||||||
...mapState(useChatsStore, ['unreadChatsCount']),
|
...mapState(useChatsStore, ['unreadChatsCount']),
|
||||||
|
...mapState(useInterfaceStore, [
|
||||||
|
'layoutType',
|
||||||
|
]),
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.scrollerRef = this.$refs.root.closest('.column.-scrollable')
|
this.scrollerRef = this.$refs.root.closest('.column.-scrollable')
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ export default {
|
||||||
localDraft: null,
|
localDraft: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['update:modelValue'],
|
||||||
created() {
|
created() {
|
||||||
if (
|
if (
|
||||||
this.realDraftMode &&
|
this.realDraftMode &&
|
||||||
|
|
@ -244,7 +245,7 @@ export default {
|
||||||
},
|
},
|
||||||
configSink() {
|
configSink() {
|
||||||
if (this.path == null) {
|
if (this.path == null) {
|
||||||
return (k, v) => this.$emit('update:modelValue', v)
|
return () => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (this.realSource) {
|
switch (this.realSource) {
|
||||||
|
|
@ -385,11 +386,13 @@ export default {
|
||||||
if (this.realDraftMode) {
|
if (this.realDraftMode) {
|
||||||
this.draft = this.getValue(e)
|
this.draft = this.getValue(e)
|
||||||
} else {
|
} else {
|
||||||
|
this.$emit('update:modelValue', this.getValue(e))
|
||||||
this.configSink(this.path, this.getValue(e))
|
this.configSink(this.path, this.getValue(e))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
commitDraft() {
|
commitDraft() {
|
||||||
if (this.realDraftMode) {
|
if (this.realDraftMode) {
|
||||||
|
this.$emit('update:modelValue', v)
|
||||||
this.configSink(this.path, this.draft)
|
this.configSink(this.path, this.draft)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
|
||||||
const GeneralTab = {
|
const GeneralTab = {
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -46,6 +47,11 @@ const GeneralTab = {
|
||||||
},
|
},
|
||||||
...SharedComputedObject(),
|
...SharedComputedObject(),
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
updateLayout() {
|
||||||
|
useInterfaceStore().setLayoutWidth()
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default GeneralTab
|
export default GeneralTab
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@
|
||||||
id="thirdColumnMode"
|
id="thirdColumnMode"
|
||||||
path="thirdColumnMode"
|
path="thirdColumnMode"
|
||||||
:options="thirdColumnModeOptions"
|
:options="thirdColumnModeOptions"
|
||||||
|
@change="updateLayout"
|
||||||
>
|
>
|
||||||
{{ $t('settings.third_column_mode') }}
|
{{ $t('settings.third_column_mode') }}
|
||||||
</ChoiceSetting>
|
</ChoiceSetting>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue