aboutsummaryrefslogtreecommitdiff
path: root/src/components/post_status_form
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-11-08 19:48:31 +0200
committerHenry Jameson <me@hjkos.com>2019-11-08 19:48:31 +0200
commit0dcb696e26dfcf97ad46e533ed4797bc9364fc01 (patch)
tree2d7b5e7d43b92eb36a9b170e9c5e32dda5d2b7b4 /src/components/post_status_form
parent6ade3be5b40816f8765e657442aa2945e51ce7d4 (diff)
parent632773ba91ef021dd589ab4d2037f5e0ed7ca5b2 (diff)
Merge remote-tracking branch 'upstream/develop' into emoji-optimizations
* upstream/develop: (95 commits) Lightbox/modal multi image improvements - #381 '/api/pleroma/profile/mfa' -> '/api/pleroma/accounts/mfa' Add ability to change user's email translations-de-batch-1 eu-translate update profile-banner rounding css, fixes #690 fix indentation remove needless ref show preview popover when hover numbered replies refactor conditions do not make too many nested div add fetchStatus action refactor status loading logic split status preview popover into a separate component uninstall mobile-detect library listen both events minor css fix restrict distance at top side only set different trigger event in desktop and mobile by default fix eslint warnings ...
Diffstat (limited to 'src/components/post_status_form')
-rw-r--r--src/components/post_status_form/post_status_form.js31
-rw-r--r--src/components/post_status_form/post_status_form.vue9
2 files changed, 14 insertions, 26 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 483c395e..af6299e4 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 60dcf90c..13e8b0aa 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -264,12 +264,9 @@
v-if="newStatus.files.length > 0"
class="upload_settings"
>
- <input
- id="filesSensitive"
- v-model="newStatus.nsfw"
- type="checkbox"
- >
- <label for="filesSensitive">{{ $t('post_status.attachments_sensitive') }}</label>
+ <Checkbox v-model="newStatus.nsfw">
+ {{ $t('post_status.attachments_sensitive') }}
+ </Checkbox>
</div>
</form>
</div>