refs #769 Switch local streaming method
This commit is contained in:
parent
c210bea4d9
commit
1e50e2dd6d
|
@ -469,20 +469,21 @@ ipcMain.on('stop-directmessages-streaming', (event, _) => {
|
|||
|
||||
let localStreaming = null
|
||||
|
||||
ipcMain.on('start-local-streaming', (event, ac) => {
|
||||
accountManager.getAccount(ac._id)
|
||||
ipcMain.on('start-local-streaming', (event, obj) => {
|
||||
const { account, useWebsocket } = obj
|
||||
accountManager.getAccount(account._id)
|
||||
.catch((err) => {
|
||||
log.error(err)
|
||||
event.sender.send('error-start-local-streaming', err)
|
||||
})
|
||||
.then((account) => {
|
||||
.then((acct) => {
|
||||
// Stop old local streaming
|
||||
if (localStreaming !== null) {
|
||||
localStreaming.stop()
|
||||
localStreaming = null
|
||||
}
|
||||
|
||||
localStreaming = new StreamingManager(account)
|
||||
localStreaming = new StreamingManager(acct, useWebsocket)
|
||||
localStreaming.start(
|
||||
'public/local',
|
||||
'',
|
||||
|
|
|
@ -276,7 +276,10 @@ const TimelineSpace = {
|
|||
},
|
||||
startLocalStreaming ({ state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
ipcRenderer.send('start-local-streaming', state.account)
|
||||
ipcRenderer.send('start-local-streaming', {
|
||||
account: state.account,
|
||||
useWebsocket: state.useWebsocket
|
||||
})
|
||||
ipcRenderer.once('error-start-local-streaming', (event, err) => {
|
||||
reject(err)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue