logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe
commit: c54b1fd0c517145f323f5fe0df9af5131137406a
parent: 562c68a51c9746650fabfc5c641816396439c791
Author: Shpuld Shpludson <shp@cock.li>
Date:   Wed, 19 Dec 2018 04:51:21 +0000

Merge branch 'fix_defaults' into 'develop'

Fixed some settings not using defaults from instance config.

Closes #228

See merge request pleroma/pleroma-fe!429

Diffstat:

Msrc/components/post_status_form/post_status_form.js6+++++-
Msrc/components/settings/settings.js12+++++++++++-
Msrc/components/status/status.js4+++-
3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js @@ -41,12 +41,16 @@ const PostStatusForm = { const preset = this.$route.query.message let statusText = preset || '' + const scopeCopy = typeof this.$store.state.config.scopeCopy === 'undefined' + ? this.$store.state.instance.scopeCopy + : this.$store.state.config.scopeCopy + if (this.replyTo) { const currentUser = this.$store.state.users.currentUser statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser) } - const scope = (this.copyMessageScope && this.$store.state.config.scopeCopy || this.copyMessageScope === 'direct') + const scope = (this.copyMessageScope && scopeCopy || this.copyMessageScope === 'direct') ? this.copyMessageScope : this.$store.state.users.currentUser.default_scope diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js @@ -15,14 +15,17 @@ const settings = { hideNsfwLocal: user.hideNsfw, hideISPLocal: user.hideISP, preloadImage: user.preloadImage, + hidePostStatsLocal: typeof user.hidePostStats === 'undefined' ? instance.hidePostStats : user.hidePostStats, hidePostStatsDefault: this.$t('settings.values.' + instance.hidePostStats), + hideUserStatsLocal: typeof user.hideUserStats === 'undefined' ? instance.hideUserStats : user.hideUserStats, hideUserStatsDefault: this.$t('settings.values.' + instance.hideUserStats), + notificationVisibilityLocal: user.notificationVisibility, replyVisibilityLocal: user.replyVisibility, loopVideoLocal: user.loopVideo, @@ -32,20 +35,27 @@ const settings = { 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), + subjectLineBehaviorLocal: typeof user.subjectLineBehavior === 'undefined' ? instance.subjectLineBehavior : user.subjectLineBehavior, subjectLineBehaviorDefault: instance.subjectLineBehavior, + alwaysShowSubjectInputLocal: typeof user.alwaysShowSubjectInput === 'undefined' ? instance.alwaysShowSubjectInput : user.alwaysShowSubjectInput, alwaysShowSubjectInputDefault: instance.alwaysShowSubjectInput, - scopeCopyLocal: user.scopeCopy, + + scopeCopyLocal: typeof user.scopeCopy === 'undefined' + ? instance.scopeCopy + : user.scopeCopy, scopeCopyDefault: this.$t('settings.values.' + instance.scopeCopy), + stopGifs: user.stopGifs, webPushNotificationsLocal: user.webPushNotifications, loopSilentAvailable: diff --git a/src/components/status/status.js b/src/components/status/status.js @@ -188,7 +188,9 @@ const Status = { }, replySubject () { if (!this.status.summary) return '' - const behavior = this.$store.state.config.subjectLineBehavior + const behavior = typeof this.$store.state.config.subjectLineBehavior === 'undefined' + ? this.$store.state.instance.subjectLineBehavior + : this.$store.state.config.subjectLineBehavior const startsWithRe = this.status.summary.match(/^re[: ]/i) if (behavior !== 'noop' && startsWithRe || behavior === 'masto') { return this.status.summary