Skip to content

Commit

Permalink
Merge pull request #570 from h3poteto/fix/reply
Browse files Browse the repository at this point in the history
Fix reply visibility level
  • Loading branch information
h3poteto authored Aug 24, 2018
2 parents 24e3983 + 67ae870 commit 0b61529
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/renderer/store/TimelineSpace/Modals/NewToot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 0b61529

Please sign in to comment.