Merge pull request #570 from h3poteto/fix/reply

Fix reply visibility level
This commit is contained in:
AkiraFukushima 2018-08-24 20:53:04 +09:00 committed by GitHub
commit 0b61529d61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 15 deletions

View File

@ -41,19 +41,6 @@ const NewToot = {
removeMedia (state, media) {
state.attachedMedias = state.attachedMedias.filter(m => m.id !== media.id)
},
/**
* changeVisibility
* Update visibility using Visibility constants
* @param state vuex state object
* @param level Visibility level
**/
changeVisibility (state, level) {
Object.keys(Visibility).map((key, index) => {
if (Visibility[key].key === level) {
this.visibility = Visibility[key].value
}
})
},
/**
* changeVisibilityValue
* Update visibility using direct value
@ -95,7 +82,14 @@ const NewToot = {
.filter((a) => a !== rootState.TimelineSpace.account.username)
commit('changeModal', true)
commit('updateStatus', `${mentionAccounts.map(m => `@${m}`).join(' ')} `)
commit('changeVisibility', message.visibility)
let value = Visibility.Public.value
Object.keys(Visibility).map((key, index) => {
const target = Visibility[key]
if (target.key === message.visibility) {
value = target.value
}
})
commit('changeVisibilityValue', value)
},
openModal ({ dispatch, commit, rootState }) {
commit('changeModal', true)
@ -109,7 +103,7 @@ const NewToot = {
commit('clearAttachedMedias')
commit('changeSensitive', false)
commit('updateSpoiler', '')
commit('changeVisibility', Visibility.Public)
commit('changeVisibilityValue', Visibility.Public.value)
},
uploadImage ({ state, commit, rootState }, image) {
commit('changeBlockSubmit', true)