From 0b46a736d6aa76a338e9871b647eb09937eb7d80 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Mon, 12 Mar 2018 23:30:55 +0900
Subject: [PATCH] refs #29 Stop old user streaming when start user streaming
---
src/main/index.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/main/index.js b/src/main/index.js
index 92e1bd5a..235811d1 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -137,6 +137,12 @@ ipcMain.on('start-user-streaming', (event, ac) => {
event.sender.send('error-start-user-streaming', err)
})
.then((account) => {
+ // Stop old user streaming
+ if (userStreaming !== null) {
+ userStreaming.stop()
+ userStreaming = null
+ }
+
userStreaming = new Streaming(account)
userStreaming.startUserStreaming(
(update) => {