From ea5ebbe501c8d1cd56a27108d18aa578a0178171 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Tue, 10 Nov 2020 21:45:23 -0500 Subject: [PATCH 1/9] FIX: double completion block being called --- ios/WalletInformationWidget/Widgets/Shared/Models.swift | 3 ++- .../Widgets/Shared/WidgetAPI+Electrum.swift | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/WalletInformationWidget/Widgets/Shared/Models.swift b/ios/WalletInformationWidget/Widgets/Shared/Models.swift index 6e86e3aca..414c5f79e 100644 --- a/ios/WalletInformationWidget/Widgets/Shared/Models.swift +++ b/ios/WalletInformationWidget/Widgets/Shared/Models.swift @@ -35,7 +35,8 @@ struct WalletData { var balance: Double var latestTransactionTime: Int = 0 var formattedBalanceBTC: String { - return "\(balance / 100000000) BTC" + let value = NSNumber(value: balance / 100000000); + return "\(value.decimalValue) BTC" } } diff --git a/ios/WalletInformationWidget/Widgets/Shared/WidgetAPI+Electrum.swift b/ios/WalletInformationWidget/Widgets/Shared/WidgetAPI+Electrum.swift index 53bf5c4fe..82197e8cd 100644 --- a/ios/WalletInformationWidget/Widgets/Shared/WidgetAPI+Electrum.swift +++ b/ios/WalletInformationWidget/Widgets/Shared/WidgetAPI+Electrum.swift @@ -36,9 +36,8 @@ extension WidgetAPI { if let response = String(bytes: data, encoding: .utf8), let nextBlockResponse = response.components(separatedBy: #"result":"#).last?.components(separatedBy: ",").first, let nextBlockResponseDouble = Double(nextBlockResponse.filter({characterSet.contains($0)}).trimmingCharacters(in: .whitespacesAndNewlines)) { print("Successfully obtained response from Electrum sever") print(userElectrumSettings) - let marketData = MarketData(nextBlock: String(format: "%.0f", (nextBlockResponseDouble / 1024) * 100000000), sats: "0", price: "0", rate: 0) client.close() - completion(MarketData(nextBlock: String(format: "%.0f", (nextBlockResponseDouble / 1024) * 100000000), sats: "0", price: "0", rate: 0), nil) + let marketData = MarketData(nextBlock: String(format: "%.0f", (nextBlockResponseDouble / 1024) * 100000000), sats: "0", price: "0", rate: 0) completion(marketData, nil) } else { client.close() From cba206f2a491ea0cf785828efdbfe6f55d3c72a3 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Tue, 10 Nov 2020 21:54:11 -0500 Subject: [PATCH 2/9] FIX: Modals transparency on desktop #2089 --- screen/wallets/addMultisig.js | 16 +++++++++++++++- screen/wallets/addMultisigStep2.js | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/screen/wallets/addMultisig.js b/screen/wallets/addMultisig.js index 92e68e90d..f8b1e93aa 100644 --- a/screen/wallets/addMultisig.js +++ b/screen/wallets/addMultisig.js @@ -1,5 +1,15 @@ import React, { useState, useRef, useEffect, useContext } from 'react'; -import { Keyboard, KeyboardAvoidingView, Platform, StatusBar, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; +import { + Keyboard, + KeyboardAvoidingView, + Platform, + StatusBar, + StyleSheet, + Text, + TouchableOpacity, + useWindowDimensions, + View, +} from 'react-native'; import LottieView from 'lottie-react-native'; import { Icon } from 'react-native-elements'; import { BlueButton, BlueListItem, BlueNavigationStyle, BlueSpacing20 } from '../../BlueComponents'; @@ -21,6 +31,8 @@ const WalletsAddMultisig = () => { const [format, setFormat] = useState(MultisigHDWallet.FORMAT_P2WSH); const { isAdancedModeEnabled } = useContext(BlueStorageContext); const [isAdvancedModeEnabledRender, setIsAdvancedModeEnabledRender] = useState(false); + const windowHeight = useWindowDimensions().height; + const windowWidth = useWindowDimensions().width; const stylesHook = StyleSheet.create({ root: { @@ -101,6 +113,8 @@ const WalletsAddMultisig = () => { Keyboard.dismiss(); setIsModalVisible(false); }} + deviceHeight={windowHeight} + deviceWidth={windowWidth} > diff --git a/screen/wallets/addMultisigStep2.js b/screen/wallets/addMultisigStep2.js index 0b9f0d058..0def65a12 100644 --- a/screen/wallets/addMultisigStep2.js +++ b/screen/wallets/addMultisigStep2.js @@ -11,6 +11,7 @@ import { StyleSheet, Text, TouchableOpacity, + useWindowDimensions, View, } from 'react-native'; import { @@ -53,6 +54,8 @@ const staticCache = {}; const WalletsAddMultisigStep2 = () => { const { addWallet, saveToDisk, setNewWalletAdded } = useContext(BlueStorageContext); const { colors } = useTheme(); + const windowHeight = useWindowDimensions().height; + const windowWidth = useWindowDimensions().width; const navigation = useNavigation(); const { m, n, format } = useRoute().params; @@ -497,7 +500,13 @@ const WalletsAddMultisigStep2 = () => { const renderMnemonicsModal = () => { return ( - + @@ -525,6 +534,8 @@ const WalletsAddMultisigStep2 = () => { const renderProvideMnemonicsModal = () => { return ( { @@ -559,6 +570,8 @@ const WalletsAddMultisigStep2 = () => { const renderCosignersXpubModal = () => { return ( { @@ -619,7 +632,7 @@ const WalletsAddMultisigStep2 = () => { const styles = StyleSheet.create({ root: { flex: 1, - marginHorizontal: 20, + paddingHorizontal: 20, }, mainBlock: { height: '100%', From d053ad6c288c4e0c06ff88f2bfba6b13a3dc789e Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Tue, 10 Nov 2020 22:27:37 -0500 Subject: [PATCH 3/9] FIX: Track time first seen of unconfirmed transactions #1699 --- BlueComponents.js | 8 +++++++- loc/en.json | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index 09f8340be..4226ca1e9 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -1646,7 +1646,13 @@ export const BlueTransactionListItem = React.memo(({ item, itemPriceUnit = Bitco [colors.lightBorder], ); - const title = useMemo(() => transactionTimeToReadable(item.received), [item.received]); + const title = useMemo(() => { + if (item.confirmations === 0) { + return loc.transactions.pending; + } else { + return transactionTimeToReadable(item.received); + } + }, [item.confirmations, item.received]); const txMemo = txMetadata[item.hash]?.memo ?? ''; const subtitle = useMemo(() => { let sub = item.confirmations < 7 ? loc.formatString(loc.transactions.list_conf, { number: item.confirmations }) : ''; diff --git a/loc/en.json b/loc/en.json index a31b978bc..a12f7d16f 100644 --- a/loc/en.json +++ b/loc/en.json @@ -310,8 +310,9 @@ "details_title": "Transaction", "details_to": "Output", "details_transaction_details": "Transaction details", - "enable_hw": "This wallet is not being used in conjunction with a hardwarde wallet. Would you like to enable hardware wallet use?", + "enable_hw": "This wallet is not being used in conjunction with a hardware wallet. Would you like to enable hardware wallet use?", "list_conf": "conf: {number}", + "pending": "Pending", "list_title": "transactions", "rbf_explain": "We will replace this transaction with the one with a higher fee, so it should be mined faster. This is called RBF - Replace By Fee.", "rbf_title": "Bump fee (RBF)", From e216ede8cb6dedc37d4025a748a34b289961ec32 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 11 Nov 2020 05:50:46 +0000 Subject: [PATCH 4/9] fix: upgrade @react-native-community/clipboard from 1.4.0 to 1.5.0 Snyk has created this PR to upgrade @react-native-community/clipboard from 1.4.0 to 1.5.0. See this package in npm: https://www.npmjs.com/package/@react-native-community/clipboard See this project in Snyk: https://app.snyk.io/org/bluewallet/project/4d0df22a-0152-410a-8584-6df0d0a596d4?utm_source=github&utm_medium=upgrade-pr --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a0ed42b8..8ee8e4f1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6316,9 +6316,9 @@ "integrity": "sha512-ael2f1onoPF3vF7YqHGWy7NnafzGu+yp88BbFbP0ydoCP2xGSUzmZVw0zakPTC040Id+JQ9WeFczujMkDy6jYQ==" }, "@react-native-community/clipboard": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@react-native-community/clipboard/-/clipboard-1.4.0.tgz", - "integrity": "sha512-71P3SgbWxwzQo/i+tHospcLdvjF9iMlPxgjWP2LgIMDY0gbwuSrtYtdnxaCraZ0S/K7FiBI7SmUrY8kl2lTDVg==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@react-native-community/clipboard/-/clipboard-1.5.0.tgz", + "integrity": "sha512-XoujTQuXhPgQLVLn7HPt7615jBEGzJm1Nhos0COdreBIz3qWIi5noYZth8jBFctf8FG5tpe24XTZNDz5udgqQQ==" }, "@react-native-community/eslint-config": { "version": "2.0.0", diff --git a/package.json b/package.json index 8323801e6..d370ba7d6 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@babel/preset-env": "7.12.1", "@react-native-community/async-storage": "1.12.1", "@react-native-community/blur": "3.6.0", - "@react-native-community/clipboard": "1.4.0", + "@react-native-community/clipboard": "1.5.0", "@react-native-community/geolocation": "2.0.2", "@react-native-community/masked-view": "0.1.10", "@react-native-community/push-notification-ios": "1.7.1", From c5bee314a4008bfb48eb341b58ff04b4c4e4793f Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Wed, 11 Nov 2020 10:58:45 -0500 Subject: [PATCH 5/9] Update Podfile.lock --- ios/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e3f44243c..60f6203e0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -349,7 +349,7 @@ PODS: - React - RNCAsyncStorage (1.12.1): - React-Core - - RNCClipboard (1.4.0): + - RNCClipboard (1.5.0): - React-Core - RNCMaskedView (0.1.10): - React @@ -719,7 +719,7 @@ SPEC CHECKSUMS: RealmJS: 899b4839a8bee46e248bc277995ad58da855e41f RemobileReactNativeQrcodeLocalImage: 57aadc12896b148fb5e04bc7c6805f3565f5c3fa RNCAsyncStorage: cb9a623793918c6699586281f0b51cbc38f046f9 - RNCClipboard: ce9b77f2881948e9e04af84bd70262ab37adb1c1 + RNCClipboard: 8f9f12fabf3c06e976f19f87a62c89e28dfedfca RNCMaskedView: f5c7d14d6847b7b44853f7acb6284c1da30a3459 RNCPushNotificationIOS: eaf01f848a0b872b194d31bcad94bb864299e01e RNDefaultPreference: 21816c0a6f61a2829ccc0cef034392e9b509ee5f From b2e4a915d6dd6430ed56f00586661a8f8288f9a9 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Tue, 10 Nov 2020 22:05:53 -0500 Subject: [PATCH 6/9] View option on creation, should be "share"? #2059 --- screen/wallets/addMultisigStep2.js | 2 +- screen/wallets/viewEditMultisigCosigners.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/screen/wallets/addMultisigStep2.js b/screen/wallets/addMultisigStep2.js index 0b9f0d058..d55b10b65 100644 --- a/screen/wallets/addMultisigStep2.js +++ b/screen/wallets/addMultisigStep2.js @@ -393,7 +393,7 @@ const WalletsAddMultisigStep2 = () => { checked={isChecked} rightButton={{ disabled: vaultKeyData.isLoading, - text: loc.multisig.view_key, + text: loc.multisig.share, onPress: () => { viewKey(cosigners[el.index]); }, diff --git a/screen/wallets/viewEditMultisigCosigners.js b/screen/wallets/viewEditMultisigCosigners.js index 3a1b2f2a9..c9941c258 100644 --- a/screen/wallets/viewEditMultisigCosigners.js +++ b/screen/wallets/viewEditMultisigCosigners.js @@ -230,7 +230,7 @@ const ViewEditMultisigCosigners = () => { button={{ buttonType: MultipleStepsListItemButtohType.partial, leftText, - text: loc.multisig.view_key, + text: loc.multisig.share, disabled: vaultKeyData.isLoading, onPress: () => { setVaultKeyData({ @@ -268,7 +268,7 @@ const ViewEditMultisigCosigners = () => { showActivityIndicator={vaultKeyData.keyIndex === el.index + 1 && vaultKeyData.isLoading} button={{ leftText, - text: loc.multisig.view_key, + text: loc.multisig.share, disabled: vaultKeyData.isLoading, buttonType: MultipleStepsListItemButtohType.partial, onPress: () => { From 2325a425e792b6ae762bd6a7b03ed2336c78af9b Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Tue, 10 Nov 2020 22:50:24 -0500 Subject: [PATCH 7/9] FIX: Some colors were not using usetheme --- screen/wallets/provideEntropy.js | 47 ++++++++++++++++++++++---------- screen/wallets/transactions.js | 15 ++-------- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/screen/wallets/provideEntropy.js b/screen/wallets/provideEntropy.js index bc6f5fa91..3e9f40c44 100644 --- a/screen/wallets/provideEntropy.js +++ b/screen/wallets/provideEntropy.js @@ -117,7 +117,19 @@ Coin.propTypes = { const Dice = ({ push, sides }) => { const { width } = useWindowDimensions(); + const { colors } = useTheme(); const diceWidth = width / 4; + const stylesHook = StyleSheet.create({ + dice: { + borderColor: colors.buttonBackgroundColor, + }, + diceText: { + color: colors.foregroundColor, + }, + diceContainer: { + backgroundColor: colors.elevated, + }, + }); const diceIcon = i => { switch (i) { case 1: @@ -136,15 +148,15 @@ const Dice = ({ push, sides }) => { }; return ( - + {[...Array(sides)].map((_, i) => ( push(getEntropy(i, sides))}> {sides === 6 ? ( ) : ( - - {i + 1} + + {i + 1} )} @@ -164,13 +176,13 @@ const buttonFontSize = ? 22 : PixelRatio.roundToNearestPixel(Dimensions.get('window').width / 26); -const Buttons = ({ pop, save }) => ( +const Buttons = ({ pop, save, colors }) => ( - + } text={loc.entropy.undo} @@ -179,7 +191,7 @@ const Buttons = ({ pop, save }) => ( onPress={save} icon={ - + } text={loc.entropy.save} @@ -190,6 +202,7 @@ const Buttons = ({ pop, save }) => ( Buttons.propTypes = { pop: PropTypes.func.isRequired, save: PropTypes.func.isRequired, + colors: PropTypes.shape.isRequired, }; const Entropy = () => { @@ -199,6 +212,17 @@ const Entropy = () => { const [tab, setTab] = useState(1); const [show, setShow] = useState(false); const { colors } = useTheme(); + const stylesHook = StyleSheet.create({ + entropy: { + backgroundColor: colors.inputBackgroundColor, + }, + entropyText: { + color: colors.foregroundColor, + }, + coinBody: { + borderColor: colors.lightButton, + }, + }); const push = v => v && dispatch({ type: 'push', value: v.value, bits: v.bits }); const pop = () => dispatch({ type: 'pop' }); @@ -216,8 +240,8 @@ const Entropy = () => { setShow(!show)}> - - {show ? hex : `${bits} of 256 bits`} + + {show ? hex : `${bits} of 256 bits`} @@ -241,7 +265,7 @@ const Entropy = () => { {tab === 1 && } {tab === 2 && } - + ); }; @@ -263,7 +287,6 @@ const styles = StyleSheet.create({ padding: 5, marginLeft: 10, marginRight: 10, - backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor, borderRadius: 9, minHeight: 49, paddingHorizontal: 8, @@ -274,7 +297,6 @@ const styles = StyleSheet.create({ entropyText: { fontSize: 15, fontFamily: 'Courier', - color: BlueCurrentTheme.colors.foregroundColor, }, coinRoot: { flex: 1, @@ -322,9 +344,6 @@ const styles = StyleSheet.create({ aspectRatio: 1, borderColor: BlueCurrentTheme.colors.buttonBackgroundColor, }, - diceText: { - color: BlueCurrentTheme.colors.foregroundColor, - }, diceIcon: { margin: 3, justifyContent: 'center', diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index 3a307c406..994d24554 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -31,7 +31,6 @@ import HandoffSettings from '../../class/handoff'; import Handoff from 'react-native-handoff'; import ActionSheet from '../ActionSheet'; import loc from '../../loc'; -import { BlueCurrentTheme } from '../../components/themes'; import { FContainer, FButton } from '../../components/FloatButtons'; import { getSystemName } from 'react-native-device-info'; import { useRoute, useNavigation, useTheme, useFocusEffect } from '@react-navigation/native'; @@ -645,12 +644,7 @@ const WalletTransactions = () => { }} icon={ - + } /> @@ -664,12 +658,7 @@ const WalletTransactions = () => { testID="SendButton" icon={ - + } /> From 5ffeb06ed845f914ee31f7efc404dfd7f473f6a1 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Tue, 10 Nov 2020 22:59:24 -0500 Subject: [PATCH 8/9] FIX: Titles on android don't show last letter #1886 --- screen/wallets/list.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/screen/wallets/list.js b/screen/wallets/list.js index 99971728f..655c436e3 100644 --- a/screen/wallets/list.js +++ b/screen/wallets/list.js @@ -193,7 +193,9 @@ const WalletsList = () => { const style = { opacity: isLoading ? 1.0 : 0.5 }; return ( - {loc.transactions.list_title} + + {`${loc.transactions.list_title}${' '}`} + {isDesktop && ( From f4ea032976846f06d4169ad9d573ef302eddda44 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Tue, 10 Nov 2020 23:05:00 -0500 Subject: [PATCH 9/9] Update details.js --- screen/wallets/details.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screen/wallets/details.js b/screen/wallets/details.js index 2d5231ed1..6d7cc1535 100644 --- a/screen/wallets/details.js +++ b/screen/wallets/details.js @@ -475,7 +475,7 @@ const WalletDetails = () => { - {loc.wallets.details_delete} + {`${loc.wallets.details_delete}${' '}`}