From 7c35b2aa3cde6b5f78cd1b745b45b97f437e9207 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Sun, 12 Apr 2020 14:54:39 +0200 Subject: [PATCH] fix(wallet): corretly sort channels by activity --- renderer/reducers/channels/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/renderer/reducers/channels/utils.js b/renderer/reducers/channels/utils.js index f4cf8c1c2d0..4d62549eb23 100644 --- a/renderer/reducers/channels/utils.js +++ b/renderer/reducers/channels/utils.js @@ -123,10 +123,12 @@ export const decorateChannel = (channelObj, nodes, closingChannelIds, loadingCha const flow = CoinBig.sum(sent, received) // Calculate capacity as flow / capacity. - return flow + const activity = flow .dividedBy(CoinBig(capacity)) .multipliedBy(100) .toFixed(0) + + return Number(activity) } return 0 @@ -152,5 +154,6 @@ export const decorateChannel = (channelObj, nodes, closingChannelIds, loadingCha channel: updatedChannelData, } } + return updatedChannelData }