diff --git a/src/App.js b/src/App.js
index fe63b54c5..04a40e304 100644
--- a/src/App.js
+++ b/src/App.js
@@ -45,7 +45,7 @@ export default {
}),
created () {
// Load the locale from the storage
- this.$i18n.locale = this.$store.state.config.interfaceLanguage
+ this.$i18n.locale = this.$store.getters.mergedConfig.interfaceLanguage
window.addEventListener('resize', this.updateMobileState)
},
destroyed () {
@@ -93,7 +93,7 @@ export default {
suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },
showInstanceSpecificPanel () {
return this.$store.state.instance.showInstanceSpecificPanel &&
- !this.$store.state.config.hideISP &&
+ !this.$store.getters.mergedConfig.hideISP &&
this.$store.state.instance.instanceSpecificPanelContent
},
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index 0880bd7fc..06b496b01 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -16,8 +16,8 @@ const Attachment = {
data () {
return {
nsfwImage: this.$store.state.instance.nsfwCensorImage || nsfwImage,
- hideNsfwLocal: this.$store.state.config.hideNsfw,
- preloadImage: this.$store.state.config.preloadImage,
+ hideNsfwLocal: this.$store.getters.mergedConfig.hideNsfw,
+ preloadImage: this.$store.getters.mergedConfig.preloadImage,
loading: false,
img: fileTypeService.fileType(this.attachment.mimetype) === 'image' && document.createElement('img'),
modalOpen: false,
@@ -58,7 +58,7 @@ const Attachment = {
}
},
openModal (event) {
- const modalTypes = this.$store.state.config.playVideosInModal
+ const modalTypes = this.$store.getters.mergedConfig.playVideosInModal
? ['image', 'video']
: ['image']
if (fileTypeService.fileMatchesSomeType(modalTypes, this.attachment) ||
@@ -71,7 +71,7 @@ const Attachment = {
}
},
toggleHidden (event) {
- if (this.$store.state.config.useOneClickNsfw && !this.showHidden) {
+ if (this.$store.getters.mergedConfig.useOneClickNsfw && !this.showHidden) {
this.openModal(event)
return
}
diff --git a/src/components/checkbox/checkbox.vue b/src/components/checkbox/checkbox.vue
index 2b822ec3f..5917598af 100644
--- a/src/components/checkbox/checkbox.vue
+++ b/src/components/checkbox/checkbox.vue
@@ -1,13 +1,22 @@
-
@@ -17,7 +26,11 @@ export default {
prop: 'checked',
event: 'change'
},
- props: ['checked', 'indeterminate']
+ props: [
+ 'checked',
+ 'indeterminate',
+ 'disabled'
+ ]
}
@@ -27,12 +40,16 @@ export default {
.checkbox {
position: relative;
display: inline-block;
- padding-left: 1.2em;
min-height: 1.2em;
+ &-indicator {
+ position: relative;
+ padding-left: 1.2em;
+ }
+
&-indicator::before {
position: absolute;
- left: 0;
+ right: 0;
top: 0;
display: block;
content: '✔';
@@ -54,6 +71,17 @@ export default {
box-sizing: border-box;
}
+ &.disabled {
+ .checkbox-indicator::before,
+ .label {
+ opacity: .5;
+ }
+ .label {
+ color: $fallback--faint;
+ color: var(--faint, $fallback--faint);
+ }
+ }
+
input[type=checkbox] {
display: none;
@@ -68,9 +96,6 @@ export default {
color: var(--text, $fallback--text);
}
- &:disabled + .checkbox-indicator::before {
- opacity: .5;
- }
}
& > span {
diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js
index a586b8191..366951c04 100644
--- a/src/components/emoji_input/emoji_input.js
+++ b/src/components/emoji_input/emoji_input.js
@@ -99,7 +99,7 @@ const EmojiInput = {
},
computed: {
padEmoji () {
- return this.$store.state.config.padEmoji
+ return this.$store.getters.mergedConfig.padEmoji
},
suggestions () {
const firstchar = this.textAtCaret.charAt(0)
diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js
index 824412ddc..b1d70176f 100644
--- a/src/components/emoji_picker/emoji_picker.js
+++ b/src/components/emoji_picker/emoji_picker.js
@@ -1,3 +1,4 @@
+import Checkbox from '../checkbox/checkbox.vue'
const filterByKeyword = (list, keyword = '') => {
return list.filter(x => x.displayText.includes(keyword))
@@ -13,7 +14,6 @@ const EmojiPicker = {
},
data () {
return {
- labelKey: String(Math.random() * 100000),
keyword: '',
activeGroup: 'custom',
showingStickers: false,
@@ -22,7 +22,8 @@ const EmojiPicker = {
}
},
components: {
- StickerPicker: () => import('../sticker_picker/sticker_picker.vue')
+ StickerPicker: () => import('../sticker_picker/sticker_picker.vue'),
+ Checkbox
},
methods: {
onEmoji (emoji) {
diff --git a/src/components/emoji_picker/emoji_picker.scss b/src/components/emoji_picker/emoji_picker.scss
index b0ed00e99..d99539b0b 100644
--- a/src/components/emoji_picker/emoji_picker.scss
+++ b/src/components/emoji_picker/emoji_picker.scss
@@ -14,10 +14,6 @@
padding: 7px;
line-height: normal;
}
- .keep-open-label {
- padding: 0 7px;
- display: flex;
- }
.heading {
display: flex;
diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue
index 42f20130c..b974fce93 100644
--- a/src/components/emoji_picker/emoji_picker.vue
+++ b/src/components/emoji_picker/emoji_picker.vue
@@ -75,22 +75,10 @@
-
-
-
-
- {{ $t('emoji.keep_open') }}
-
-
+
+
+ {{ $t('emoji.keep_open') }}
+
- {{ status.fave_num }}
+ {{ status.fave_num }}
- {{ status.fave_num }}
+ {{ status.fave_num }}
diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js
index bd0de608c..f856fd0a5 100644
--- a/src/components/gallery/gallery.js
+++ b/src/components/gallery/gallery.js
@@ -29,7 +29,7 @@ const Gallery = {
return rows
},
useContainFit () {
- return this.$store.state.config.useContainFit
+ return this.$store.getters.mergedConfig.useContainFit
}
},
methods: {
diff --git a/src/components/interface_language_switcher/interface_language_switcher.vue b/src/components/interface_language_switcher/interface_language_switcher.vue
index 83df9a0bd..1ca220015 100644
--- a/src/components/interface_language_switcher/interface_language_switcher.vue
+++ b/src/components/interface_language_switcher/interface_language_switcher.vue
@@ -40,7 +40,7 @@ export default {
},
language: {
- get: function () { return this.$store.state.config.interfaceLanguage },
+ get: function () { return this.$store.getters.mergedConfig.interfaceLanguage },
set: function (val) {
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
this.$i18n.locale = val
diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js
index c2bb76eeb..5a90c31f4 100644
--- a/src/components/mobile_nav/mobile_nav.js
+++ b/src/components/mobile_nav/mobile_nav.js
@@ -63,7 +63,7 @@ const MobileNav = {
this.$refs.notifications.markAsSeen()
},
onScroll ({ target: { scrollTop, clientHeight, scrollHeight } }) {
- if (this.$store.state.config.autoLoad && scrollTop + clientHeight >= scrollHeight) {
+ if (this.$store.getters.mergedConfig.autoLoad && scrollTop + clientHeight >= scrollHeight) {
this.$refs.notifications.fetchOlderNotifications()
}
}
diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js
index 3e77148aa..0ad12bb11 100644
--- a/src/components/mobile_post_status_button/mobile_post_status_button.js
+++ b/src/components/mobile_post_status_button/mobile_post_status_button.js
@@ -30,7 +30,7 @@ const MobilePostStatusButton = {
return this.autohideFloatingPostButton && (this.hidden || this.inputActive)
},
autohideFloatingPostButton () {
- return !!this.$store.state.config.autohideFloatingPostButton
+ return !!this.$store.getters.mergedConfig.autohideFloatingPostButton
}
},
watch: {
diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js
index 8e817f3be..7d46eb5aa 100644
--- a/src/components/notification/notification.js
+++ b/src/components/notification/notification.js
@@ -39,7 +39,7 @@ const Notification = {
return highlightClass(this.notification.from_profile)
},
userStyle () {
- const highlight = this.$store.state.config.highlight
+ const highlight = this.$store.getters.mergedConfig.highlight
const user = this.notification.from_profile
return highlightStyle(highlight[user.screen_name])
},
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 9b2a9c90d..c1d7209e2 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -7,6 +7,8 @@ import fileTypeService from '../../services/file_type/file_type.service.js'
import { findOffset } from '../../services/offset_finder/offset_finder.service.js'
import { reject, map, uniqBy } from 'lodash'
import suggestor from '../emoji_input/suggestor.js'
+import { mapGetters } from 'vuex'
+import Checkbox from '../checkbox/checkbox.vue'
const buildMentionsString = ({ user, attentions = [] }, currentUser) => {
let allAttentions = [...attentions]
@@ -35,7 +37,8 @@ const PostStatusForm = {
MediaUpload,
EmojiInput,
PollForm,
- ScopeSelector
+ ScopeSelector,
+ Checkbox
},
mounted () {
this.resize(this.$refs.textarea)
@@ -50,9 +53,7 @@ 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
+ const { scopeCopy } = this.$store.getters.mergedConfig
if (this.replyTo) {
const currentUser = this.$store.state.users.currentUser
@@ -63,9 +64,7 @@ const PostStatusForm = {
? this.copyMessageScope
: this.$store.state.users.currentUser.default_scope
- const contentType = typeof this.$store.state.config.postContentType === 'undefined'
- ? this.$store.state.instance.postContentType
- : this.$store.state.config.postContentType
+ const { postContentType: contentType } = this.$store.getters.mergedConfig
return {
dropFiles: [],
@@ -94,10 +93,7 @@ const PostStatusForm = {
return this.$store.state.users.currentUser.default_scope
},
showAllScopes () {
- const minimalScopesMode = typeof this.$store.state.config.minimalScopesMode === 'undefined'
- ? this.$store.state.instance.minimalScopesMode
- : this.$store.state.config.minimalScopesMode
- return !minimalScopesMode
+ return !this.mergedConfig.minimalScopesMode
},
emojiUserSuggestor () {
return suggestor({
@@ -145,13 +141,7 @@ const PostStatusForm = {
return this.$store.state.instance.minimalScopesMode
},
alwaysShowSubject () {
- if (typeof this.$store.state.config.alwaysShowSubjectInput !== 'undefined') {
- return this.$store.state.config.alwaysShowSubjectInput
- } else if (typeof this.$store.state.instance.alwaysShowSubjectInput !== 'undefined') {
- return this.$store.state.instance.alwaysShowSubjectInput
- } else {
- return true
- }
+ return this.mergedConfig.alwaysShowSubjectInput
},
postFormats () {
return this.$store.state.instance.postFormats || []
@@ -164,13 +154,14 @@ const PostStatusForm = {
this.$store.state.instance.pollLimits.max_options >= 2
},
hideScopeNotice () {
- return this.$store.state.config.hideScopeNotice
+ return this.$store.getters.mergedConfig.hideScopeNotice
},
pollContentError () {
return this.pollFormVisible &&
this.newStatus.poll &&
this.newStatus.poll.error
- }
+ },
+ ...mapGetters(['mergedConfig'])
},
methods: {
postStatus (newStatus) {
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 4916d988b..237ed725a 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -261,12 +261,9 @@
v-if="newStatus.files.length > 0"
class="upload_settings"
>
-
- {{ $t('post_status.attachments_sensitive') }}
+
+ {{ $t('post_status.attachments_sensitive') }}
+
diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js
index fb543a9c6..d9a0f92e6 100644
--- a/src/components/retweet_button/retweet_button.js
+++ b/src/components/retweet_button/retweet_button.js
@@ -1,10 +1,9 @@
+import { mapGetters } from 'vuex'
+
const RetweetButton = {
props: ['status', 'loggedIn', 'visibility'],
data () {
return {
- hidePostStatsLocal: typeof this.$store.state.config.hidePostStats === 'undefined'
- ? this.$store.state.instance.hidePostStats
- : this.$store.state.config.hidePostStats,
animated: false
}
},
@@ -28,7 +27,8 @@ const RetweetButton = {
'retweeted-empty': !this.status.repeated,
'animate-spin': this.animated
}
- }
+ },
+ ...mapGetters(['mergedConfig'])
}
}
diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue
index d58a7f8cd..074f7747b 100644
--- a/src/components/retweet_button/retweet_button.vue
+++ b/src/components/retweet_button/retweet_button.vue
@@ -7,7 +7,7 @@
:title="$t('tool_tip.repeat')"
@click.prevent="retweet()"
/>
- {{ status.repeat_num }}
+ {{ status.repeat_num }}
- {{ status.repeat_num }}
+ {{ status.repeat_num }}
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js
index b6540d7ec..c49083f9f 100644
--- a/src/components/settings/settings.js
+++ b/src/components/settings/settings.js
@@ -5,88 +5,22 @@ import TabSwitcher from '../tab_switcher/tab_switcher.js'
import StyleSwitcher from '../style_switcher/style_switcher.vue'
import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue'
import { extractCommit } from '../../services/version/version.service'
+import { instanceDefaultProperties, defaultState as configDefaultState } from '../../modules/config.js'
+import Checkbox from '../checkbox/checkbox.vue'
const pleromaFeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma-fe/commit/'
const pleromaBeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma/commit/'
+const multiChoiceProperties = [
+ 'postContentType',
+ 'subjectLineBehavior'
+]
+
const settings = {
data () {
- const user = this.$store.state.config
const instance = this.$store.state.instance
return {
- hideAttachmentsLocal: user.hideAttachments,
- padEmojiLocal: user.padEmoji,
- hideAttachmentsInConvLocal: user.hideAttachmentsInConv,
- maxThumbnails: user.maxThumbnails,
- hideNsfwLocal: user.hideNsfw,
- useOneClickNsfw: user.useOneClickNsfw,
- 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),
-
- hideFilteredStatusesLocal: typeof user.hideFilteredStatuses === 'undefined'
- ? instance.hideFilteredStatuses
- : user.hideFilteredStatuses,
- hideFilteredStatusesDefault: this.$t('settings.values.' + instance.hideFilteredStatuses),
-
- notificationVisibilityLocal: user.notificationVisibility,
- replyVisibilityLocal: user.replyVisibility,
- loopVideoLocal: user.loopVideo,
- muteWordsString: user.muteWords.join('\n'),
- autoLoadLocal: user.autoLoad,
- streamingLocal: user.streaming,
- pauseOnUnfocusedLocal: user.pauseOnUnfocused,
- hoverPreviewLocal: user.hoverPreview,
- autohideFloatingPostButtonLocal: user.autohideFloatingPostButton,
-
- hideMutedPostsLocal: typeof user.hideMutedPosts === 'undefined'
- ? instance.hideMutedPosts
- : user.hideMutedPosts,
- hideMutedPostsDefault: this.$t('settings.values.' + instance.hideMutedPosts),
-
- 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,
-
- postContentTypeLocal: typeof user.postContentType === 'undefined'
- ? instance.postContentType
- : user.postContentType,
- postContentTypeDefault: instance.postContentType,
-
- alwaysShowSubjectInputLocal: typeof user.alwaysShowSubjectInput === 'undefined'
- ? instance.alwaysShowSubjectInput
- : user.alwaysShowSubjectInput,
- alwaysShowSubjectInputDefault: this.$t('settings.values.' + instance.alwaysShowSubjectInput),
-
- scopeCopyLocal: typeof user.scopeCopy === 'undefined'
- ? instance.scopeCopy
- : user.scopeCopy,
- scopeCopyDefault: this.$t('settings.values.' + instance.scopeCopy),
-
- minimalScopesModeLocal: typeof user.minimalScopesMode === 'undefined'
- ? instance.minimalScopesMode
- : user.minimalScopesMode,
- minimalScopesModeDefault: this.$t('settings.values.' + instance.minimalScopesMode),
-
- stopGifs: user.stopGifs,
- webPushNotificationsLocal: user.webPushNotifications,
- loopVideoSilentOnlyLocal: user.loopVideosSilentOnly,
loopSilentAvailable:
// Firefox
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
@@ -94,8 +28,6 @@ const settings = {
Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||
// Future spec, still not supported in Nightly 63 as of 08/2018
Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks'),
- playVideosInModal: user.playVideosInModal,
- useContainFit: user.useContainFit,
backendVersion: instance.backendVersion,
frontendVersion: instance.frontendVersion
@@ -104,7 +36,8 @@ const settings = {
components: {
TabSwitcher,
StyleSwitcher,
- InterfaceLanguageSwitcher
+ InterfaceLanguageSwitcher,
+ Checkbox
},
computed: {
user () {
@@ -122,116 +55,56 @@ const settings = {
},
backendVersionLink () {
return pleromaBeCommitUrl + extractCommit(this.backendVersion)
+ },
+ // Getting localized values for instance-default properties
+ ...instanceDefaultProperties
+ .filter(key => multiChoiceProperties.includes(key))
+ .map(key => [
+ key + 'DefaultValue',
+ function () {
+ return this.$store.getters.instanceDefaultConfig[key]
+ }
+ ])
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
+ ...instanceDefaultProperties
+ .filter(key => !multiChoiceProperties.includes(key))
+ .map(key => [
+ key + 'LocalizedValue',
+ function () {
+ return this.$t('settings.values.' + this.$store.getters.instanceDefaultConfig[key])
+ }
+ ])
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
+ // Generating computed values for vuex properties
+ ...Object.keys(configDefaultState)
+ .map(key => [key, {
+ get () { return this.$store.getters.mergedConfig[key] },
+ set (value) {
+ this.$store.dispatch('setOption', { name: key, value })
+ }
+ }])
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
+ // Special cases (need to transform values)
+ muteWordsString: {
+ get () { return this.$store.getters.mergedConfig.muteWords.join('\n') },
+ set (value) {
+ this.$store.dispatch('setOption', {
+ name: 'muteWords',
+ value: filter(value.split('\n'), (word) => trim(word).length > 0)
+ })
+ }
}
},
+ // Updating nested properties
watch: {
- hideAttachmentsLocal (value) {
- this.$store.dispatch('setOption', { name: 'hideAttachments', value })
- },
- padEmojiLocal (value) {
- this.$store.dispatch('setOption', { name: 'padEmoji', value })
- },
- hideAttachmentsInConvLocal (value) {
- this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value })
- },
- hidePostStatsLocal (value) {
- this.$store.dispatch('setOption', { name: 'hidePostStats', value })
- },
- hideUserStatsLocal (value) {
- this.$store.dispatch('setOption', { name: 'hideUserStats', value })
- },
- hideFilteredStatusesLocal (value) {
- this.$store.dispatch('setOption', { name: 'hideFilteredStatuses', value })
- },
- hideNsfwLocal (value) {
- this.$store.dispatch('setOption', { name: 'hideNsfw', value })
- },
- useOneClickNsfw (value) {
- this.$store.dispatch('setOption', { name: 'useOneClickNsfw', value })
- },
- preloadImage (value) {
- this.$store.dispatch('setOption', { name: 'preloadImage', value })
- },
- hideISPLocal (value) {
- this.$store.dispatch('setOption', { name: 'hideISP', value })
- },
- 'notificationVisibilityLocal.likes' (value) {
- this.$store.dispatch('setOption', { name: 'notificationVisibility', value: this.$store.state.config.notificationVisibility })
- },
- 'notificationVisibilityLocal.follows' (value) {
- this.$store.dispatch('setOption', { name: 'notificationVisibility', value: this.$store.state.config.notificationVisibility })
- },
- 'notificationVisibilityLocal.repeats' (value) {
- this.$store.dispatch('setOption', { name: 'notificationVisibility', value: this.$store.state.config.notificationVisibility })
- },
- 'notificationVisibilityLocal.mentions' (value) {
- this.$store.dispatch('setOption', { name: 'notificationVisibility', value: this.$store.state.config.notificationVisibility })
- },
- replyVisibilityLocal (value) {
- this.$store.dispatch('setOption', { name: 'replyVisibility', value })
- },
- loopVideoLocal (value) {
- this.$store.dispatch('setOption', { name: 'loopVideo', value })
- },
- loopVideoSilentOnlyLocal (value) {
- this.$store.dispatch('setOption', { name: 'loopVideoSilentOnly', value })
- },
- autoLoadLocal (value) {
- this.$store.dispatch('setOption', { name: 'autoLoad', value })
- },
- streamingLocal (value) {
- this.$store.dispatch('setOption', { name: 'streaming', value })
- },
- pauseOnUnfocusedLocal (value) {
- this.$store.dispatch('setOption', { name: 'pauseOnUnfocused', value })
- },
- hoverPreviewLocal (value) {
- this.$store.dispatch('setOption', { name: 'hoverPreview', value })
- },
- autohideFloatingPostButtonLocal (value) {
- this.$store.dispatch('setOption', { name: 'autohideFloatingPostButton', value })
- },
- muteWordsString (value) {
- value = filter(value.split('\n'), (word) => trim(word).length > 0)
- this.$store.dispatch('setOption', { name: 'muteWords', value })
- },
- hideMutedPostsLocal (value) {
- this.$store.dispatch('setOption', { name: 'hideMutedPosts', value })
- },
- collapseMessageWithSubjectLocal (value) {
- this.$store.dispatch('setOption', { name: 'collapseMessageWithSubject', value })
- },
- scopeCopyLocal (value) {
- this.$store.dispatch('setOption', { name: 'scopeCopy', value })
- },
- alwaysShowSubjectInputLocal (value) {
- this.$store.dispatch('setOption', { name: 'alwaysShowSubjectInput', value })
- },
- subjectLineBehaviorLocal (value) {
- this.$store.dispatch('setOption', { name: 'subjectLineBehavior', value })
- },
- postContentTypeLocal (value) {
- this.$store.dispatch('setOption', { name: 'postContentType', value })
- },
- minimalScopesModeLocal (value) {
- this.$store.dispatch('setOption', { name: 'minimalScopesMode', value })
- },
- stopGifs (value) {
- this.$store.dispatch('setOption', { name: 'stopGifs', value })
- },
- webPushNotificationsLocal (value) {
- this.$store.dispatch('setOption', { name: 'webPushNotifications', value })
- if (value) this.$store.dispatch('registerPushNotifications')
- },
- playVideosInModal (value) {
- this.$store.dispatch('setOption', { name: 'playVideosInModal', value })
- },
- useContainFit (value) {
- this.$store.dispatch('setOption', { name: 'useContainFit', value })
- },
- maxThumbnails (value) {
- value = this.maxThumbnails = Math.floor(Math.max(value, 0))
- this.$store.dispatch('setOption', { name: 'maxThumbnails', value })
+ notificationVisibility: {
+ handler (value) {
+ this.$store.dispatch('setOption', {
+ name: 'notificationVisibility',
+ value: this.$store.getters.mergedConfig.notificationVisibility
+ })
+ },
+ deep: true
}
}
}
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index 6d87a0603..a83489d2c 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -36,12 +36,9 @@
-
- {{ $t('settings.hide_isp') }}
+
+ {{ $t('settings.hide_isp') }}
+
@@ -49,58 +46,42 @@
{{ $t('nav.timeline') }}
@@ -109,24 +90,14 @@
{{ $t('settings.composing') }}
-
-
-
- {{ $t('settings.scope_copy') }} {{ $t('settings.instance_default', { value: scopeCopyDefault }) }}
-
+
+ {{ $t('settings.scope_copy') }} {{ $t('settings.instance_default', { value: scopeCopyLocalizedValue }) }}
+
-
-
-
- {{ $t('settings.subject_input_always_show') }} {{ $t('settings.instance_default', { value: alwaysShowSubjectInputDefault }) }}
-
+
+ {{ $t('settings.subject_input_always_show') }} {{ $t('settings.instance_default', { value: alwaysShowSubjectInputLocalizedValue }) }}
+
-
@@ -137,19 +108,19 @@
>
@@ -165,7 +136,7 @@
>
@@ -181,30 +152,19 @@
-
-
-
- {{ $t('settings.minimal_scopes_mode') }} {{ $t('settings.instance_default', { value: minimalScopesModeDefault }) }}
-
+
+ {{ $t('settings.minimal_scopes_mode') }} {{ $t('settings.instance_default', { value: minimalScopesModeLocalizedValue }) }}
+
-
-
- {{ $t('settings.autohide_floating_post_button') }}
+
+ {{ $t('settings.autohide_floating_post_button') }}
+
-
-
- {{ $t('settings.pad_emoji') }}
+
+ {{ $t('settings.pad_emoji') }}
+
@@ -213,23 +173,19 @@
{{ $t('settings.attachments') }}