Browse Source

Dead code + websocket logs

gre-patch-1
Gaëtan Renaudeau 6 years ago
parent
commit
dd16c8b209
No known key found for this signature in database GPG Key ID: 7B66B85F042E5451
  1. 28
      src/components/ManagerPage/AppsList.js
  2. 8
      src/helpers/live-common-setup.js

28
src/components/ManagerPage/AppsList.js

@ -100,34 +100,6 @@ class AppsList extends PureComponent<Props, State> {
_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

8
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)
})

Loading…
Cancel
Save