mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-27 07:46:15 +01:00
refs #24 Remove ipcRenderer listeners for keyboard shortcuts
This commit is contained in:
parent
4f47a79bf7
commit
2eb0454a24
@ -22,9 +22,9 @@ export default {
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
this.$store.dispatch('TimelineSpace/watchShortcutEvents')
|
||||
this.$store.dispatch('TimelineSpace/fetchAccount', this.$route.params.id)
|
||||
.then((account) => {
|
||||
this.$store.dispatch('TimelineSpace/watchShortcutEvents', account)
|
||||
this.$store.dispatch('TimelineSpace/fetchHomeTimeline', account)
|
||||
.then(() => {
|
||||
loading.close()
|
||||
@ -68,6 +68,7 @@ export default {
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.$store.dispatch('TimelineSpace/stopUserStreaming')
|
||||
this.$store.dispatch('TimelineSpace/removeShortcutEvents')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -99,7 +99,7 @@ const TimelineSpace = {
|
||||
ipcRenderer.removeAll('error-start-user-streaming')
|
||||
ipcRenderer.send('stop-user-streaming')
|
||||
},
|
||||
watchShortcutEvents ({ commit }, account) {
|
||||
watchShortcutEvents ({ commit }) {
|
||||
ipcRenderer.on('CmdOrCtrl+N', () => {
|
||||
commit('changeNewTootModal', true)
|
||||
})
|
||||
@ -108,6 +108,10 @@ const TimelineSpace = {
|
||||
console.log('reply')
|
||||
})
|
||||
},
|
||||
removeShortcutEvents () {
|
||||
ipcRenderer.removeAll('CmdOrCtrl+N')
|
||||
ipcRenderer.removeAll('CmdOrCtrl+R')
|
||||
},
|
||||
fetchHomeTimeline ({ commit }, account) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const client = new Mastodon(
|
||||
|
Loading…
x
Reference in New Issue
Block a user