separation
This commit is contained in:
parent
912aa228d1
commit
573a980512
12 changed files with 56 additions and 31 deletions
|
|
@ -183,7 +183,7 @@ const getTOS = async ({ store }) => {
|
||||||
const res = await window.fetch('/static/terms-of-service.html')
|
const res = await window.fetch('/static/terms-of-service.html')
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const html = await res.text()
|
const html = await res.text()
|
||||||
useInstanceStore().set({ name: 'tos', value: html })
|
useInstanceStore().set({ name: 'instanceIdentity.tos', value: html })
|
||||||
} else {
|
} else {
|
||||||
throw res
|
throw res
|
||||||
}
|
}
|
||||||
|
|
@ -198,7 +198,7 @@ const getInstancePanel = async ({ store }) => {
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const html = await res.text()
|
const html = await res.text()
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
name: 'instanceSpecificPanelContent',
|
name: 'instanceIdentity.instanceSpecificPanelContent',
|
||||||
value: html,
|
value: html,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@ export default (store) => {
|
||||||
if (store.state.users.currentUser) {
|
if (store.state.users.currentUser) {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
next(useInstanceStore().instanceIdentity.redirectRootNoLogin || '/main/all')
|
next(
|
||||||
|
useInstanceStore().instanceIdentity.redirectRootNoLogin || '/main/all',
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,7 +52,8 @@ export default (store) => {
|
||||||
return (
|
return (
|
||||||
(store.state.users.currentUser
|
(store.state.users.currentUser
|
||||||
? useInstanceStore().instanceIdentity.redirectRootLogin
|
? useInstanceStore().instanceIdentity.redirectRootLogin
|
||||||
: useInstanceStore().instanceIdentity.redirectRootNoLogin) || '/main/all'
|
: useInstanceStore().instanceIdentity.redirectRootNoLogin) ||
|
||||||
|
'/main/all'
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ const About = {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
showFeaturesPanel() {
|
showFeaturesPanel() {
|
||||||
return useInstanceStore().showFeaturesPanel
|
return useInstanceStore().instanceIdentity.showFeaturesPanel
|
||||||
},
|
},
|
||||||
showInstanceSpecificPanel() {
|
showInstanceSpecificPanel() {
|
||||||
return (
|
return (
|
||||||
useInstanceStore().showInstanceSpecificPanel &&
|
useInstanceStore().instanceIdentity.showInstanceSpecificPanel &&
|
||||||
!this.$store.getters.mergedConfig.hideISP &&
|
!this.$store.getters.mergedConfig.hideISP &&
|
||||||
useInstanceStore().instanceSpecificPanelContent
|
useInstanceStore().instanceIdentity.instanceSpecificPanelContent
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,8 @@ const Attachment = {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
localDescription: this.description || this.attachment.description,
|
localDescription: this.description || this.attachment.description,
|
||||||
nsfwImage: useInstanceStore().nsfwCensorImage || nsfwImage,
|
nsfwImage:
|
||||||
|
useInstanceStore().instanceIdentity.nsfwCensorImage || nsfwImage,
|
||||||
hideNsfwLocal: this.$store.getters.mergedConfig.hideNsfw,
|
hideNsfwLocal: this.$store.getters.mergedConfig.hideNsfw,
|
||||||
preloadImage: this.$store.getters.mergedConfig.preloadImage,
|
preloadImage: this.$store.getters.mergedConfig.preloadImage,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
@ -105,7 +106,9 @@ const Attachment = {
|
||||||
return 'file'
|
return 'file'
|
||||||
},
|
},
|
||||||
referrerpolicy() {
|
referrerpolicy() {
|
||||||
return useInstanceStore().mediaProxyAvailable ? '' : 'no-referrer'
|
return useInstanceStore().featureSet.mediaProxyAvailable
|
||||||
|
? ''
|
||||||
|
: 'no-referrer'
|
||||||
},
|
},
|
||||||
type() {
|
type() {
|
||||||
return fileTypeService.fileType(this.attachment.mimetype)
|
return fileTypeService.fileType(this.attachment.mimetype)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import SearchBar from 'components/search_bar/search_bar.vue'
|
import SearchBar from 'components/search_bar/search_bar.vue'
|
||||||
import { mapState, mapActions } from 'pinia'
|
import { mapActions, mapState } from 'pinia'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface'
|
import { useInterfaceStore } from 'src/stores/interface'
|
||||||
|
|
@ -123,6 +123,6 @@ export default {
|
||||||
onSearchBarToggled(hidden) {
|
onSearchBarToggled(hidden) {
|
||||||
this.searchBarHidden = hidden
|
this.searchBarHidden = hidden
|
||||||
},
|
},
|
||||||
...mapActions(useInterfaceStore, ['openSettingsModal'])
|
...mapActions(useInterfaceStore, ['openSettingsModal']),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
const InstanceSpecificPanel = {
|
const InstanceSpecificPanel = {
|
||||||
computed: {
|
computed: {
|
||||||
instanceSpecificPanelContent() {
|
instanceSpecificPanelContent() {
|
||||||
return useInstanceStore().instanceSpecificPanelContent
|
return useInstanceStore().instanceIdentity.instanceSpecificPanelContent
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -274,11 +274,11 @@ const AppearanceTab = {
|
||||||
return !window.IntersectionObserver
|
return !window.IntersectionObserver
|
||||||
},
|
},
|
||||||
instanceWallpaper() {
|
instanceWallpaper() {
|
||||||
useInstanceStore().background
|
useInstanceStore().instanceIdentity.background
|
||||||
},
|
},
|
||||||
instanceWallpaperUsed() {
|
instanceWallpaperUsed() {
|
||||||
return (
|
return (
|
||||||
useInstanceStore().background &&
|
useInstanceStore().instanceIdentity.background &&
|
||||||
!this.$store.state.users.currentUser.background_image
|
!this.$store.state.users.currentUser.background_image
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
@ -333,13 +333,23 @@ const AppearanceTab = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isThemeActive(key) {
|
isThemeActive(key) {
|
||||||
return key === (this.mergedConfig.theme || useInstanceStore().theme)
|
return (
|
||||||
|
key ===
|
||||||
|
(this.mergedConfig.theme || useInstanceStore().instanceIdentity.theme)
|
||||||
|
)
|
||||||
},
|
},
|
||||||
isStyleActive(key) {
|
isStyleActive(key) {
|
||||||
return key === (this.mergedConfig.style || useInstanceStore().style)
|
return (
|
||||||
|
key ===
|
||||||
|
(this.mergedConfig.style || useInstanceStore().instanceIdentity.style)
|
||||||
|
)
|
||||||
},
|
},
|
||||||
isPaletteActive(key) {
|
isPaletteActive(key) {
|
||||||
return key === (this.mergedConfig.palette || useInstanceStore().palette)
|
return (
|
||||||
|
key ===
|
||||||
|
(this.mergedConfig.palette ||
|
||||||
|
useInstanceStore().instanceIdentity.palette)
|
||||||
|
)
|
||||||
},
|
},
|
||||||
...mapActions(useInterfaceStore, ['setStyle', 'setTheme']),
|
...mapActions(useInterfaceStore, ['setStyle', 'setTheme']),
|
||||||
setPalette(name, data) {
|
setPalette(name, data) {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ const FilteringTab = {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
instanceSpecificPanelPresent() {
|
instanceSpecificPanelPresent() {
|
||||||
return useInstanceStore().showInstanceSpecificPanel
|
return useInstanceStore().instanceIdentity.showInstanceSpecificPanel
|
||||||
},
|
},
|
||||||
...SharedComputedObject(),
|
...SharedComputedObject(),
|
||||||
...mapState(useServerSideStorageStore, {
|
...mapState(useServerSideStorageStore, {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { mapState, mapActions } from 'pinia'
|
import { mapActions, mapState } from 'pinia'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
import { USERNAME_ROUTES } from 'src/components/navigation/navigation.js'
|
import { USERNAME_ROUTES } from 'src/components/navigation/navigation.js'
|
||||||
|
|
@ -105,7 +105,8 @@ const SideDrawer = {
|
||||||
logo: (store) => store.instanceIdentity.logo,
|
logo: (store) => store.instanceIdentity.logo,
|
||||||
sitename: (store) => store.instanceIdentity.name,
|
sitename: (store) => store.instanceIdentity.name,
|
||||||
hideSitename: (store) => store.instanceIdentity.hideSitename,
|
hideSitename: (store) => store.instanceIdentity.hideSitename,
|
||||||
pleromaChatMessagesAvailable: (store) => store.featureSet.pleromaChatMessagesAvailable,
|
pleromaChatMessagesAvailable: (store) =>
|
||||||
|
store.featureSet.pleromaChatMessagesAvailable,
|
||||||
suggestionsEnabled: (store) => store.featureSet.suggestionsEnabled,
|
suggestionsEnabled: (store) => store.featureSet.suggestionsEnabled,
|
||||||
}),
|
}),
|
||||||
...mapGetters(['unreadChatCount', 'draftCount']),
|
...mapGetters(['unreadChatCount', 'draftCount']),
|
||||||
|
|
@ -124,7 +125,7 @@ const SideDrawer = {
|
||||||
touchMove(e) {
|
touchMove(e) {
|
||||||
GestureService.updateSwipe(e, this.closeGesture)
|
GestureService.updateSwipe(e, this.closeGesture)
|
||||||
},
|
},
|
||||||
...mapActions(useInterfaceStore, ['openSettingsModal'])
|
...mapActions(useInterfaceStore, ['openSettingsModal']),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,12 @@
|
||||||
|
import { mapState } from 'pinia'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
|
|
||||||
const TermsOfServicePanel = {
|
const TermsOfServicePanel = {
|
||||||
computed: {
|
computed: mapState(useInstanceStore, {
|
||||||
content() {
|
content: (store) => store.instanceIdentity.tos,
|
||||||
return useInstanceStore().tos
|
embedded: (store) => store.instanceIdentity.embeddedToS,
|
||||||
},
|
}),
|
||||||
embedded() {
|
|
||||||
return useInstanceStore().embeddedToS
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TermsOfServicePanel
|
export default TermsOfServicePanel
|
||||||
|
|
|
||||||
|
|
@ -337,10 +337,16 @@ export default {
|
||||||
return this.newBanner === null ? currentUrl : newUrl
|
return this.newBanner === null ? currentUrl : newUrl
|
||||||
},
|
},
|
||||||
defaultAvatar() {
|
defaultAvatar() {
|
||||||
return useInstanceStore().server + useInstanceStore().defaultAvatar
|
return (
|
||||||
|
useInstanceStore().server +
|
||||||
|
useInstanceStore().instanceIdentity.defaultAvatar
|
||||||
|
)
|
||||||
},
|
},
|
||||||
defaultBanner() {
|
defaultBanner() {
|
||||||
return useInstanceStore().server + useInstanceStore().defaultBanner
|
return (
|
||||||
|
useInstanceStore().server +
|
||||||
|
useInstanceStore().instanceIdentity.defaultBanner
|
||||||
|
)
|
||||||
},
|
},
|
||||||
isDefaultAvatar() {
|
isDefaultAvatar() {
|
||||||
const baseAvatar = useInstanceStore().defaultAvatar
|
const baseAvatar = useInstanceStore().defaultAvatar
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ export const staticOrApiConfigDefault = {
|
||||||
nsfwCensorImage: null,
|
nsfwCensorImage: null,
|
||||||
showFeaturesPanel: true,
|
showFeaturesPanel: true,
|
||||||
showInstanceSpecificPanel: false,
|
showInstanceSpecificPanel: false,
|
||||||
|
|
||||||
|
// Html stuff
|
||||||
|
instanceSpecificPanelContent: '',
|
||||||
|
tos: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This object contains setting entries that makes sense
|
/// This object contains setting entries that makes sense
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue