From 668d0d08c847ccb5d5cabaa9d3fb55e53ea4b8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Mon, 4 Jun 2018 17:49:35 +0200 Subject: [PATCH] fix bitcoin fees to use Standard by default --- src/components/FeesField/BitcoinKind.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/FeesField/BitcoinKind.js b/src/components/FeesField/BitcoinKind.js index 9422df27..be8a8f23 100644 --- a/src/components/FeesField/BitcoinKind.js +++ b/src/components/FeesField/BitcoinKind.js @@ -37,6 +37,7 @@ const blockCountNameConvention = { '3': 'Standard', // (normal confirmation)', '6': 'Low', // (slow confirmation)', } +const defaultBlockCount = 3 const customItem = { label: 'Custom', @@ -86,7 +87,9 @@ class FeesField extends Component< const { items, isFocused } = this.state if (fees && !feePerByte && !isFocused) { // initialize with the median - onChange(items[Math.floor(items.length / 2)].feePerByte) + const feePerByte = (items.find(item => item.blockCount === defaultBlockCount) || items[0]) + .feePerByte + onChange(feePerByte) } }