mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-11 16:35:09 +01:00
refs #16 Handle error when could not start user stream
This commit is contained in:
parent
4c227b2dfa
commit
0dc1788a89
@ -26,6 +26,12 @@ export default {
|
||||
})
|
||||
})
|
||||
this.$store.dispatch('TimelineSpace/startUserStreaming', account)
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
message: 'Could not start user streaming',
|
||||
type: 'error'
|
||||
})
|
||||
})
|
||||
this.$store.dispatch('TimelineSpace/username', account)
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
|
@ -69,11 +69,6 @@ const TimelineSpace = {
|
||||
})
|
||||
},
|
||||
startUserStreaming ({ commit }, account) {
|
||||
ipcRenderer.send('start-user-streaming', account)
|
||||
ipcRenderer.once('error-start-userstreaming', (event, err) => {
|
||||
// handle error
|
||||
console.log(err)
|
||||
})
|
||||
ipcRenderer.on('update-start-user-streaming', (event, update) => {
|
||||
commit('appendHomeTimeline', update)
|
||||
})
|
||||
@ -84,6 +79,13 @@ const TimelineSpace = {
|
||||
}
|
||||
commit('appendNotifications', notification)
|
||||
})
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
ipcRenderer.send('start-user-streaming', account)
|
||||
ipcRenderer.once('error-start-userstreaming', (event, err) => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
stopUserStreaming ({ commit }) {
|
||||
ipcRenderer.send('stop-user-streaming')
|
||||
|
Loading…
Reference in New Issue
Block a user