From 4253bb791d0b40076cd076cc65c6d26019829418 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Tue, 18 Dec 2018 23:30:04 +0900 Subject: [PATCH] refs #769 Switch hashtag streaming method --- src/main/index.js | 9 +++++---- src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index a6979cfd..3efca3cd 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -585,22 +585,23 @@ ipcMain.on('stop-list-streaming', (event, _) => { let tagStreaming = null ipcMain.on('start-tag-streaming', (event, obj) => { - accountManager.getAccount(obj.account._id) + const { tag, account, useWebsocket } = obj + accountManager.getAccount(account._id) .catch((err) => { log.error(err) event.sender.send('error-start-tag-streaming', err) }) - .then((account) => { + .then((acct) => { // Stop old tag streaming if (tagStreaming !== null) { tagStreaming.stop() tagStreaming = null } - tagStreaming = new StreamingManager(account) + tagStreaming = new StreamingManager(acct, useWebsocket) tagStreaming.start( 'hashtag', - `tag=${obj.tag}`, + `tag=${tag}`, (update) => { event.sender.send('update-start-tag-streaming', update) }, diff --git a/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js b/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js index e0d828c9..e6122c7e 100644 --- a/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js +++ b/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js @@ -91,7 +91,8 @@ const Tag = { return new Promise((resolve, reject) => { ipcRenderer.send('start-tag-streaming', { tag: encodeURIComponent(tag), - account: rootState.TimelineSpace.account + account: rootState.TimelineSpace.account, + useWebsocket: rootState.TimelineSpace.useWebsocket }) ipcRenderer.once('error-start-tag-streaming', (event, err) => { reject(err)