Merge pull request #2477 from BlueWallet/multisighlabel

FIX: Add wallet->set custom label->create multisig: label is not set …
This commit is contained in:
GLaDOS 2021-01-10 13:58:18 +00:00 committed by GitHub
commit 4bed6e0917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 15 deletions

View File

@ -449,6 +449,7 @@
},
"multisig": {
"multisig_vault": "Vault",
"default_label": "Multisig Vault",
"multisig_vault_explain": "Best security for large amounts",
"provide_signature": "Provide signature",
"vault_key": "Vault key {number}",

View File

@ -6,15 +6,7 @@ import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { colors } from 'react-native-elements';
import navigationStyle from '../../components/navigationStyle';
import {
BlueLoading,
SafeBlueArea,
BlueSpacing20,
BlueCard,
BlueListItem,
BlueHeaderDefaultSub,
BlueText,
} from '../../BlueComponents';
import { BlueLoading, SafeBlueArea, BlueSpacing20, BlueCard, BlueListItem, BlueHeaderDefaultSub, BlueText } from '../../BlueComponents';
import Biometric from '../../class/biometrics';
import loc from '../../loc';
import { BlueStorageContext } from '../../blue_modules/storage-context';

View File

@ -152,7 +152,7 @@ const WalletsAdd = () => {
}
} else if (selectedWalletType === ButtonSelected.VAULT) {
setIsLoading(false);
navigate('WalletsAddMultisig');
navigate('WalletsAddMultisig', { walletLabel: label.trim().length > 0 ? label : loc.multisig.default_label });
}
};

View File

@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect, useContext } from 'react';
import { Keyboard, KeyboardAvoidingView, Platform, StatusBar, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import LottieView from 'lottie-react-native';
import { Icon } from 'react-native-elements';
import { useNavigation, useTheme } from '@react-navigation/native';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { BlueButton, BlueListItem, BlueSpacing20 } from '../../BlueComponents';
@ -16,7 +16,7 @@ const WalletsAddMultisig = () => {
const { colors } = useTheme();
const { navigate } = useNavigation();
const loadingAnimation = useRef();
const { walletLabel = loc.multisig.default_label } = useRoute().params;
const [m, setM] = useState(2);
const [n, setN] = useState(3);
const [isModalVisible, setIsModalVisible] = useState(false);
@ -60,7 +60,7 @@ const WalletsAddMultisig = () => {
}, []);
const onLetsStartPress = () => {
navigate('WalletsAddMultisigStep2', { m, n, format });
navigate('WalletsAddMultisigStep2', { m, n, format, walletLabel });
};
const setFormatP2wsh = () => setFormat(MultisigHDWallet.FORMAT_P2WSH);

View File

@ -54,7 +54,7 @@ const WalletsAddMultisigStep2 = () => {
const { colors } = useTheme();
const navigation = useNavigation();
const { m, n, format } = useRoute().params;
const { m, n, format, walletLabel } = useRoute().params;
const [cosigners, setCosigners] = useState([]); // array of cosigners user provided. if format [cosigner, fp, path]
const [isLoading, setIsLoading] = useState(false);
@ -166,7 +166,7 @@ const WalletsAddMultisigStep2 = () => {
const fp = cc[1] || getFpCacheForMnemonics(cc[0]);
w.addCosigner(cc[0], fp, cc[2]);
}
w.setLabel('Multisig Vault');
w.setLabel(walletLabel);
await w.fetchBalance();
addWallet(w);