From dd16c8b209135365e1b0a2547b64a269bec0fc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Fri, 21 Dec 2018 12:38:55 +0100 Subject: [PATCH] Dead code + websocket logs --- src/components/ManagerPage/AppsList.js | 28 -------------------------- src/helpers/live-common-setup.js | 8 ++++++++ 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/src/components/ManagerPage/AppsList.js b/src/components/ManagerPage/AppsList.js index 1aef7d88..115c8904 100644 --- a/src/components/ManagerPage/AppsList.js +++ b/src/components/ManagerPage/AppsList.js @@ -100,34 +100,6 @@ class AppsList extends PureComponent { _unmounted = false - prepareAppList = ({ applicationsList, compatibleAppVersionsList, sortedCryptoCurrencies }) => { - const filtered = this.props.isDevMode - ? compatibleAppVersionsList.slice(0) - : compatibleAppVersionsList.filter(version => { - const app = applicationsList.find(e => e.id === version.app) - if (app) { - return app.category !== 2 - } - - return false - }) - - const sortedCryptoApps = [] - - // sort by crypto first - sortedCryptoCurrencies.forEach(crypto => { - const app = filtered.find( - item => item.name.toLowerCase() === crypto.managerAppName.toLowerCase(), - ) - if (app) { - filtered.splice(filtered.indexOf(app), 1) - sortedCryptoApps.push(app) - } - }) - - return sortedCryptoApps.concat(filtered) - } - async fetchAppList() { const { deviceInfo, isDevMode } = this.props diff --git a/src/helpers/live-common-setup.js b/src/helpers/live-common-setup.js index 458cdf39..8a20fbe1 100644 --- a/src/helpers/live-common-setup.js +++ b/src/helpers/live-common-setup.js @@ -1,10 +1,18 @@ // @flow import WebSocket from 'ws' import { setNetwork, setWebSocketImplementation } from '@ledgerhq/live-common/lib/network' +import { logs as websocketLogs } from '@ledgerhq/live-common/lib/api/socket' import { setEnv } from '@ledgerhq/live-common/lib/env' import network from 'api/network' import * as constants from 'config/constants' +import logger from 'logger' setWebSocketImplementation(WebSocket) setNetwork(network) setEnv('FORCE_PROVIDER', constants.FORCE_PROVIDER) + +websocketLogs.subscribe(({ type, message, ...rest }) => { + const obj = rest + if (message) obj.msg = message + logger.websocket(type, obj) +})