diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-02-26 19:23:53 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-02-26 19:23:53 +0900 |
| commit | d939e552f3b42a3f38981c9e650001f01a73bfad (patch) | |
| tree | df6799e574737afd362912a55dc8c98a3d755def /src/web/app/common/scripts/streaming/stream.ts | |
| parent | Fix bug (diff) | |
| download | sharkey-d939e552f3b42a3f38981c9e650001f01a73bfad.tar.gz sharkey-d939e552f3b42a3f38981c9e650001f01a73bfad.tar.bz2 sharkey-d939e552f3b42a3f38981c9e650001f01a73bfad.zip | |
Fix bugs
Diffstat (limited to 'src/web/app/common/scripts/streaming/stream.ts')
| -rw-r--r-- | src/web/app/common/scripts/streaming/stream.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/web/app/common/scripts/streaming/stream.ts b/src/web/app/common/scripts/streaming/stream.ts index 770d77510f..8799f6fe6b 100644 --- a/src/web/app/common/scripts/streaming/stream.ts +++ b/src/web/app/common/scripts/streaming/stream.ts @@ -1,13 +1,12 @@ -declare const _API_URL_: string; - import { EventEmitter } from 'eventemitter3'; import * as ReconnectingWebsocket from 'reconnecting-websocket'; +import { apiUrl } from '../../../config'; /** * Misskey stream connection */ export default class Connection extends EventEmitter { - private state: string; + public state: string; private buffer: any[]; private socket: ReconnectingWebsocket; @@ -25,7 +24,7 @@ export default class Connection extends EventEmitter { this.state = 'initializing'; this.buffer = []; - const host = _API_URL_.replace('http', 'ws'); + const host = apiUrl.replace('http', 'ws'); const query = params ? Object.keys(params) .map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k])) @@ -58,7 +57,7 @@ export default class Connection extends EventEmitter { */ private onClose() { this.state = 'reconnecting'; - this.emit('_closed_'); + this.emit('_disconnected_'); } /** |