Commit d93928ff by ken

depth

parent f8845e4c
......@@ -99,6 +99,9 @@ const _subscribe = function(callback, opened_callback = false) {
ws.on('close', _handleSocketClose.bind(ws));
ws.on('message', function(data) {
try {
data = pako.inflate(data, {
to: 'string'
});
callback(JSON.parse(data));
} catch (error) {
console.log('Parse error: '+error.message);
......@@ -109,9 +112,6 @@ const _subscribe = function(callback, opened_callback = false) {
function subscribe() {
_subscribe((data) => {
data = pako.inflate(data, {
to: 'string'
});
if (data.channel === accountInfoChannel) {
try {
const coins = data.data.coins;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment