some initial work on moving instance settings to pinia
This commit is contained in:
parent
20071d5a11
commit
9452b3084a
10 changed files with 559 additions and 195 deletions
41
src/App.js
41
src/App.js
|
|
@ -22,6 +22,7 @@ import UserReportingModal from './components/user_reporting_modal/user_reporting
|
|||
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
|
||||
import { getOrCreateServiceWorker } from './services/sw/sw'
|
||||
import { windowHeight, windowWidth } from './services/window_utils/window_utils'
|
||||
import { useInstanceStore } from './stores/instance'
|
||||
import { useInterfaceStore } from './stores/interface'
|
||||
import { useShoutStore } from './stores/shout'
|
||||
|
||||
|
|
@ -135,11 +136,6 @@ export default {
|
|||
userBackground() {
|
||||
return this.currentUser.background_image
|
||||
},
|
||||
instanceBackground() {
|
||||
return this.mergedConfig.hideInstanceWallpaper
|
||||
? null
|
||||
: this.$store.state.instance.background
|
||||
},
|
||||
background() {
|
||||
return this.userBackground || this.instanceBackground
|
||||
},
|
||||
|
|
@ -153,16 +149,6 @@ export default {
|
|||
shout() {
|
||||
return useShoutStore().joined
|
||||
},
|
||||
suggestionsEnabled() {
|
||||
return this.$store.state.instance.suggestionsEnabled
|
||||
},
|
||||
showInstanceSpecificPanel() {
|
||||
return (
|
||||
this.$store.state.instance.showInstanceSpecificPanel &&
|
||||
!this.$store.getters.mergedConfig.hideISP &&
|
||||
this.$store.state.instance.instanceSpecificPanelContent
|
||||
)
|
||||
},
|
||||
isChats() {
|
||||
return this.$route.name === 'chat' || this.$route.name === 'chats'
|
||||
},
|
||||
|
|
@ -177,21 +163,12 @@ export default {
|
|||
this.layoutType === 'mobile'
|
||||
)
|
||||
},
|
||||
showFeaturesPanel() {
|
||||
return this.$store.state.instance.showFeaturesPanel
|
||||
},
|
||||
editingAvailable() {
|
||||
return this.$store.state.instance.editingAvailable
|
||||
},
|
||||
shoutboxPosition() {
|
||||
return this.$store.getters.mergedConfig.alwaysShowNewPostButton || false
|
||||
},
|
||||
layoutType() {
|
||||
return useInterfaceStore().layoutType
|
||||
},
|
||||
privateMode() {
|
||||
return this.$store.state.instance.private
|
||||
},
|
||||
reverseLayout() {
|
||||
const { thirdColumnMode, sidebarRight: reverseSetting } =
|
||||
this.$store.getters.mergedConfig
|
||||
|
|
@ -214,8 +191,22 @@ export default {
|
|||
},
|
||||
...mapGetters(['mergedConfig']),
|
||||
...mapState(useServerSideStorageStore, {
|
||||
hideShoutbox: (store) => store.prefsStorage.simple.hideShoutbox,
|
||||
hideShoutbox: (store) => store.mergedConfig.hideShoutbox,
|
||||
}),
|
||||
...mapState(useInstanceStore, {
|
||||
instanceBackground: (store) =>
|
||||
this.mergedConfig.hideInstanceWallpaper ? null : store.background,
|
||||
showInstanceSpecificPanel: (store) =>
|
||||
store.showInstanceSpecificPanel &&
|
||||
!this.$store.getters.mergedConfig.hideISP &&
|
||||
store.instanceSpecificPanelContent,
|
||||
}),
|
||||
...mapState(useInstanceStore, [
|
||||
'editingAvailable',
|
||||
'showFeaturesPanel',
|
||||
'private',
|
||||
'suggestionsEnabled',
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
resizeHandler() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue