diff --git a/config/index.js b/config/index.js index 5d2cb83398..7b0ef26cf3 100644 --- a/config/index.js +++ b/config/index.js @@ -27,6 +27,11 @@ module.exports = { changeOrigin: true, cookieDomainRewrite: 'localhost' }, + '/nodeinfo': { + target: 'http://localhost:4000/', + changeOrigin: true, + cookieDomainRewrite: 'localhost' + }, '/socket': { target: 'http://localhost:4000/', changeOrigin: true, diff --git a/src/App.js b/src/App.js index be6548f3a0..05e3eda35e 100644 --- a/src/App.js +++ b/src/App.js @@ -36,9 +36,9 @@ export default { computed: { currentUser () { return this.$store.state.users.currentUser }, background () { - return this.currentUser.background_image || this.$store.state.config.background + return this.currentUser.background_image || this.$store.state.instance.background }, - enableMask () { return this.supportsMask && this.$store.state.config.logoMask }, + enableMask () { return this.supportsMask && this.$store.state.instance.logoMask }, logoStyle () { return { 'visibility': this.enableMask ? 'hidden' : 'visible' @@ -46,24 +46,24 @@ export default { }, logoMaskStyle () { return this.enableMask ? { - 'mask-image': `url(${this.$store.state.config.logo})` + 'mask-image': `url(${this.$store.state.instance.logo})` } : { 'background-color': this.enableMask ? '' : 'transparent' } }, logoBgStyle () { return Object.assign({ - 'margin': `${this.$store.state.config.logoMargin} 0` + 'margin': `${this.$store.state.instance.logoMargin} 0` }, this.enableMask ? {} : { 'background-color': this.enableMask ? '' : 'transparent' }) }, - logo () { return this.$store.state.config.logo }, + logo () { return this.$store.state.instance.logo }, style () { return { 'background-image': `url(${this.background})` } }, - sitename () { return this.$store.state.config.name }, + sitename () { return this.$store.state.instance.name }, chat () { return this.$store.state.chat.channel.state === 'joined' }, - suggestionsEnabled () { return this.$store.state.config.suggestionsEnabled }, - showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel } + suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled }, + showInstanceSpecificPanel () { return this.$store.state.instance.showInstanceSpecificPanel } }, methods: { activatePanel (panelName) { diff --git a/src/components/features_panel/features_panel.js b/src/components/features_panel/features_panel.js index 80f5c966f8..e0b7a1185d 100644 --- a/src/components/features_panel/features_panel.js +++ b/src/components/features_panel/features_panel.js @@ -1,13 +1,13 @@ const FeaturesPanel = { computed: { chat: function () { - return this.$store.state.config.chatAvailable && (!this.$store.state.chatDisabled) + return this.$store.state.instance.chatAvailable && (!this.$store.state.chatDisabled) }, - gopher: function () { return this.$store.state.config.gopherAvailable }, - whoToFollow: function () { return this.$store.state.config.suggestionsEnabled }, - mediaProxy: function () { return this.$store.state.config.mediaProxyAvailable }, - scopeOptions: function () { return this.$store.state.config.scopeOptionsEnabled }, - textlimit: function () { return this.$store.state.config.textlimit } + gopher: function () { return this.$store.state.instance.gopherAvailable }, + whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled }, + mediaProxy: function () { return this.$store.state.instance.mediaProxyAvailable }, + scopeOptions: function () { return this.$store.state.instance.scopeOptionsEnabled }, + textlimit: function () { return this.$store.state.instance.textlimit } } } diff --git a/src/components/instance_specific_panel/instance_specific_panel.js b/src/components/instance_specific_panel/instance_specific_panel.js index abd408c8f8..09e3d0557f 100644 --- a/src/components/instance_specific_panel/instance_specific_panel.js +++ b/src/components/instance_specific_panel/instance_specific_panel.js @@ -1,7 +1,7 @@ const InstanceSpecificPanel = { computed: { instanceSpecificPanelContent () { - return this.$store.state.config.instanceSpecificPanelContent + return this.$store.state.instance.instanceSpecificPanelContent } } } diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js index a117b76fd2..4405fb92fb 100644 --- a/src/components/login_form/login_form.js +++ b/src/components/login_form/login_form.js @@ -5,7 +5,7 @@ const LoginForm = { }), computed: { loggingIn () { return this.$store.state.users.loggingIn }, - registrationOpen () { return this.$store.state.config.registrationOpen } + registrationOpen () { return this.$store.state.instance.registrationOpen } }, methods: { submit () { diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 7babe2365b..a84e764c18 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -102,7 +102,7 @@ const PostStatusForm = { name: '', utf: utf || '', // eslint-disable-next-line camelcase - img: utf ? '' : this.$store.state.config.server + image_url, + img: utf ? '' : this.$store.state.instance.server + image_url, highlighted: index === this.highlighted })) } else { @@ -120,16 +120,16 @@ const PostStatusForm = { return this.$store.state.users.users }, emoji () { - return this.$store.state.config.emoji || [] + return this.$store.state.instance.emoji || [] }, customEmoji () { - return this.$store.state.config.customEmoji || [] + return this.$store.state.instance.customEmoji || [] }, statusLength () { return this.newStatus.status.length }, statusLengthLimit () { - return this.$store.state.config.textlimit + return this.$store.state.instance.textlimit }, hasStatusLengthLimit () { return this.statusLengthLimit > 0 @@ -141,10 +141,10 @@ const PostStatusForm = { return this.hasStatusLengthLimit && (this.statusLength > this.statusLengthLimit) }, scopeOptionsEnabled () { - return this.$store.state.config.scopeOptionsEnabled + return this.$store.state.instance.scopeOptionsEnabled }, formattingOptionsEnabled () { - return this.$store.state.config.formattingOptionsEnabled + return this.$store.state.instance.formattingOptionsEnabled } }, methods: { diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index 738406082d..8f59878d39 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -5,16 +5,16 @@ const registration = { registering: false }), created () { - if ((!this.$store.state.config.registrationOpen && !this.token) || !!this.$store.state.users.currentUser) { + if ((!this.$store.state.instance.registrationOpen && !this.token) || !!this.$store.state.users.currentUser) { this.$router.push('/main/all') } // Seems like this doesn't work at first page open for some reason - if (this.$store.state.config.registrationOpen && this.token) { + if (this.$store.state.instance.registrationOpen && this.token) { this.$router.push('/registration') } }, computed: { - termsofservice () { return this.$store.state.config.tos }, + termsofservice () { return this.$store.state.instance.tos }, token () { return this.$route.params.token } }, methods: { diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 8ef84b2a78..a24bc265fa 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -6,25 +6,27 @@ import { filter, trim } from 'lodash' const settings = { data () { - const config = this.$store.state.config + const user = this.$store.state.config + const instance = this.$store.state.instance return { - hideAttachmentsLocal: config.hideAttachments, - hideAttachmentsInConvLocal: config.hideAttachmentsInConv, - hideNsfwLocal: config.hideNsfw, - notificationVisibilityLocal: config.notificationVisibility, - replyVisibilityLocal: config.replyVisibility, - loopVideoLocal: config.loopVideo, - loopVideoSilentOnlyLocal: config.loopVideoSilentOnly, - muteWordsString: config.muteWords.join('\n'), - autoLoadLocal: config.autoLoad, - streamingLocal: config.streaming, - pauseOnUnfocusedLocal: config.pauseOnUnfocused, - hoverPreviewLocal: config.hoverPreview, - collapseMessageWithSubjectLocal: typeof config.collapseMessageWithSubject === 'undefined' - ? config.defaultCollapseMessageWithSubject - : config.collapseMessageWithSubject, - stopGifs: config.stopGifs, + hideAttachmentsLocal: user.hideAttachments, + hideAttachmentsInConvLocal: user.hideAttachmentsInConv, + hideNsfwLocal: user.hideNsfw, + notificationVisibilityLocal: user.notificationVisibility, + replyVisibilityLocal: user.replyVisibility, + loopVideoLocal: user.loopVideo, + loopVideoSilentOnlyLocal: user.loopVideoSilentOnly, + muteWordsString: user.muteWords.join('\n'), + autoLoadLocal: user.autoLoad, + streamingLocal: user.streaming, + pauseOnUnfocusedLocal: user.pauseOnUnfocused, + hoverPreviewLocal: user.hoverPreview, + collapseMessageWithSubjectLocal: typeof user.collapseMessageWithSubject === 'undefined' + ? instance.collapseMessageWithSubject + : user.collapseMessageWithSubject, + collapseMessageWithSubjectDefault: this.$t('settings.values.' + instance.collapseMessageWithSubject), + stopGifs: user.stopGifs, loopSilentAvailable: // Firefox Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') || @@ -42,6 +44,9 @@ const settings = { computed: { user () { return this.$store.state.users.currentUser + }, + currentSaveStateNotice () { + return this.$store.state.interface.settings.currentSaveStateNotice } }, watch: { diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index c106b79cfe..42c660a3c3 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -1,7 +1,21 @@