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