1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-02-03 10:47:34 +01:00

Merge pull request #404 from h3poteto/iss-380

closes #380 Set visibility from source message when reply
This commit is contained in:
AkiraFukushima 2018-06-19 22:48:02 +09:00 committed by GitHub
commit 14bb991b98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 15 deletions

View File

@ -70,7 +70,7 @@ export default {
} }
}, },
openNewTootModal () { openNewTootModal () {
this.$store.commit('TimelineSpace/Modals/NewToot/changeModal', true) this.$store.dispatch('TimelineSpace/Modals/NewToot/openModal')
} }
} }
} }

View File

@ -97,7 +97,11 @@ export default {
return this.$store.state.TimelineSpace.Modals.NewToot.modalOpen return this.$store.state.TimelineSpace.Modals.NewToot.modalOpen
}, },
set (value) { set (value) {
this.$store.dispatch('TimelineSpace/Modals/NewToot/changeModal', value) if (value) {
this.$store.dispatch('TimelineSpace/Modals/NewToot/openModal')
} else {
this.$store.dispatch('TimelineSpace/Modals/NewToot/closeModal')
}
} }
}, },
status: { status: {
@ -136,7 +140,7 @@ export default {
methods: { methods: {
close () { close () {
this.resetImage() this.resetImage()
this.$store.dispatch('TimelineSpace/Modals/NewToot/changeModal', false) this.$store.dispatch('TimelineSpace/Modals/NewToot/closeModal')
}, },
toot () { toot () {
if (!this.newTootModal) { if (!this.newTootModal) {

View File

@ -121,9 +121,9 @@ const TimelineSpace = {
ipcRenderer.send('stop-local-streaming') ipcRenderer.send('stop-local-streaming')
return 'stopLocalStreaming' return 'stopLocalStreaming'
}, },
watchShortcutEvents ({ commit }) { watchShortcutEvents ({ commit, dispatch }) {
ipcRenderer.on('CmdOrCtrl+N', () => { ipcRenderer.on('CmdOrCtrl+N', () => {
commit('TimelineSpace/Modals/NewToot/changeModal', true, { root: true }) dispatch('TimelineSpace/Modals/NewToot/openModal', {}, { root: true })
}) })
ipcRenderer.on('CmdOrCtrl+K', () => { ipcRenderer.on('CmdOrCtrl+K', () => {
commit('TimelineSpace/Modals/Jump/changeModal', true, { root: true }) commit('TimelineSpace/Modals/Jump/changeModal', true, { root: true })

View File

@ -65,19 +65,22 @@ const NewToot = {
const mentionAccounts = [message.account.acct].concat(message.mentions.map(a => a.acct)) const mentionAccounts = [message.account.acct].concat(message.mentions.map(a => a.acct))
.filter((a, i, self) => self.indexOf(a) === i) .filter((a, i, self) => self.indexOf(a) === i)
.filter((a) => a !== rootState.TimelineSpace.account.username) .filter((a) => a !== rootState.TimelineSpace.account.username)
commit('changeModal', true)
commit('updateStatus', `${mentionAccounts.map(m => `@${m}`).join(' ')} `) commit('updateStatus', `${mentionAccounts.map(m => `@${m}`).join(' ')} `)
commit('changeVisibility', message.visibility)
},
openModal ({ commit }) {
commit('changeModal', true) commit('changeModal', true)
}, },
changeModal ({ commit }, value) { closeModal ({ commit }) {
commit('changeModal', value) commit('changeModal', false)
if (!value) {
commit('updateStatus', '') commit('updateStatus', '')
commit('setReplyTo', null) commit('setReplyTo', null)
commit('changeBlockSubmit', false) commit('changeBlockSubmit', false)
commit('clearAttachedMedias') commit('clearAttachedMedias')
commit('changeSensitive', false) commit('changeSensitive', false)
commit('updateSpoiler', '') commit('updateSpoiler', '')
} commit('changeVisibility', 'public')
}, },
uploadImage ({ state, commit, rootState }, image) { uploadImage ({ state, commit, rootState }, image) {
commit('changeBlockSubmit', true) commit('changeBlockSubmit', true)