mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-02-08 07:48:45 +01:00
refs #461 Set default visibility from preferences in new toot modal
This commit is contained in:
parent
8638bee417
commit
af43064700
@ -147,9 +147,12 @@ export default {
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
const visibilityKey = Object.keys(Visibility).find((key) => {
|
||||
return Visibility[key].value === this.visibility
|
||||
})
|
||||
let form = {
|
||||
status: this.status,
|
||||
visibility: this.visibility,
|
||||
visibility: Visibility[visibilityKey].name,
|
||||
sensitive: this.sensitive,
|
||||
spoiler_text: this.spoiler
|
||||
}
|
||||
|
@ -39,12 +39,22 @@ const NewToot = {
|
||||
},
|
||||
/**
|
||||
* changeVisibility
|
||||
* Update visibility using Visibility constants
|
||||
* @param state vuex state object
|
||||
* @param visibility Visibility constants object
|
||||
**/
|
||||
changeVisibility (state, visibility) {
|
||||
state.visibility = visibility.value
|
||||
},
|
||||
/**
|
||||
* changeVisibilityValue
|
||||
* Update visibility using direct value
|
||||
* @param state vuex state object
|
||||
* @param value visibility value
|
||||
**/
|
||||
changeVisibilityValue (state, value) {
|
||||
state.visibility = value
|
||||
},
|
||||
changeSensitive (state, value) {
|
||||
state.sensitive = value
|
||||
},
|
||||
@ -79,8 +89,12 @@ const NewToot = {
|
||||
commit('updateStatus', `${mentionAccounts.map(m => `@${m}`).join(' ')} `)
|
||||
dispatch('changeVisibility', message.visibility)
|
||||
},
|
||||
openModal ({ commit }) {
|
||||
openModal ({ dispatch, commit }) {
|
||||
commit('changeModal', true)
|
||||
ipcRenderer.send('get-preferences')
|
||||
ipcRenderer.once('response-get-preferences', (event, conf) => {
|
||||
commit('changeVisibilityValue', conf.general.tootVisibility)
|
||||
})
|
||||
},
|
||||
closeModal ({ commit }) {
|
||||
commit('changeModal', false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user