mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-04 12:18:10 +01:00
FIX: Add wallet->set custom label->create multisig: label is not set to created wallet
This commit is contained in:
parent
25852b75f7
commit
9db39b4f2a
5 changed files with 8 additions and 15 deletions
|
@ -449,6 +449,7 @@
|
||||||
},
|
},
|
||||||
"multisig": {
|
"multisig": {
|
||||||
"multisig_vault": "Vault",
|
"multisig_vault": "Vault",
|
||||||
|
"default_label": "Multisig Vault",
|
||||||
"multisig_vault_explain": "Best security for large amounts",
|
"multisig_vault_explain": "Best security for large amounts",
|
||||||
"provide_signature": "Provide signature",
|
"provide_signature": "Provide signature",
|
||||||
"vault_key": "Vault key {number}",
|
"vault_key": "Vault key {number}",
|
||||||
|
|
|
@ -6,15 +6,7 @@ import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
|
||||||
import { colors } from 'react-native-elements';
|
import { colors } from 'react-native-elements';
|
||||||
|
|
||||||
import navigationStyle from '../../components/navigationStyle';
|
import navigationStyle from '../../components/navigationStyle';
|
||||||
import {
|
import { BlueLoading, SafeBlueArea, BlueSpacing20, BlueCard, BlueListItem, BlueHeaderDefaultSub, BlueText } from '../../BlueComponents';
|
||||||
BlueLoading,
|
|
||||||
SafeBlueArea,
|
|
||||||
BlueSpacing20,
|
|
||||||
BlueCard,
|
|
||||||
BlueListItem,
|
|
||||||
BlueHeaderDefaultSub,
|
|
||||||
BlueText,
|
|
||||||
} from '../../BlueComponents';
|
|
||||||
import Biometric from '../../class/biometrics';
|
import Biometric from '../../class/biometrics';
|
||||||
import loc from '../../loc';
|
import loc from '../../loc';
|
||||||
import { BlueStorageContext } from '../../blue_modules/storage-context';
|
import { BlueStorageContext } from '../../blue_modules/storage-context';
|
||||||
|
|
|
@ -152,7 +152,7 @@ const WalletsAdd = () => {
|
||||||
}
|
}
|
||||||
} else if (selectedWalletType === ButtonSelected.VAULT) {
|
} else if (selectedWalletType === ButtonSelected.VAULT) {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
navigate('WalletsAddMultisig');
|
navigate('WalletsAddMultisig', { walletLabel: label.trim().length > 1 ? label : loc.multisig.default_label });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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 { Keyboard, KeyboardAvoidingView, Platform, StatusBar, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import LottieView from 'lottie-react-native';
|
import LottieView from 'lottie-react-native';
|
||||||
import { Icon } from 'react-native-elements';
|
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 { SafeAreaView } from 'react-native-safe-area-context';
|
||||||
|
|
||||||
import { BlueButton, BlueListItem, BlueSpacing20 } from '../../BlueComponents';
|
import { BlueButton, BlueListItem, BlueSpacing20 } from '../../BlueComponents';
|
||||||
|
@ -16,7 +16,7 @@ const WalletsAddMultisig = () => {
|
||||||
const { colors } = useTheme();
|
const { colors } = useTheme();
|
||||||
const { navigate } = useNavigation();
|
const { navigate } = useNavigation();
|
||||||
const loadingAnimation = useRef();
|
const loadingAnimation = useRef();
|
||||||
|
const { walletLabel = loc.multisig.default_label } = useRoute().params;
|
||||||
const [m, setM] = useState(2);
|
const [m, setM] = useState(2);
|
||||||
const [n, setN] = useState(3);
|
const [n, setN] = useState(3);
|
||||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||||
|
@ -60,7 +60,7 @@ const WalletsAddMultisig = () => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onLetsStartPress = () => {
|
const onLetsStartPress = () => {
|
||||||
navigate('WalletsAddMultisigStep2', { m, n, format });
|
navigate('WalletsAddMultisigStep2', { m, n, format, walletLabel });
|
||||||
};
|
};
|
||||||
|
|
||||||
const setFormatP2wsh = () => setFormat(MultisigHDWallet.FORMAT_P2WSH);
|
const setFormatP2wsh = () => setFormat(MultisigHDWallet.FORMAT_P2WSH);
|
||||||
|
|
|
@ -54,7 +54,7 @@ const WalletsAddMultisigStep2 = () => {
|
||||||
const { colors } = useTheme();
|
const { colors } = useTheme();
|
||||||
|
|
||||||
const navigation = useNavigation();
|
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 [cosigners, setCosigners] = useState([]); // array of cosigners user provided. if format [cosigner, fp, path]
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
@ -166,7 +166,7 @@ const WalletsAddMultisigStep2 = () => {
|
||||||
const fp = cc[1] || getFpCacheForMnemonics(cc[0]);
|
const fp = cc[1] || getFpCacheForMnemonics(cc[0]);
|
||||||
w.addCosigner(cc[0], fp, cc[2]);
|
w.addCosigner(cc[0], fp, cc[2]);
|
||||||
}
|
}
|
||||||
w.setLabel('Multisig Vault');
|
w.setLabel(walletLabel);
|
||||||
await w.fetchBalance();
|
await w.fetchBalance();
|
||||||
|
|
||||||
addWallet(w);
|
addWallet(w);
|
||||||
|
|
Loading…
Add table
Reference in a new issue