diff --git a/class/wallet-import.js b/class/wallet-import.js index 01066c4a1..10f3011e0 100644 --- a/class/wallet-import.js +++ b/class/wallet-import.js @@ -35,11 +35,10 @@ function WalletImport() { /** * * @param w {AbstractWallet} - * @param additionalProperties key-values passed from outside. Used only to set up `masterFingerprint` property for watch-only wallet * @returns {Promise} * @private */ - WalletImport._saveWallet = async (w, additionalProperties) => { + WalletImport._saveWallet = async w => { IdleTimerManager.setIdleTimerDisabled(false); if (WalletImport.isWalletImported(w)) { WalletImport.presentWalletAlreadyExistsAlert(); @@ -49,11 +48,6 @@ function WalletImport() { ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false }); if (w.getLabel() === emptyWalletLabel) w.setLabel(loc.wallets.import_imported + ' ' + w.typeReadable); w.setUserHasSavedExport(true); - if (additionalProperties) { - for (const [key, value] of Object.entries(additionalProperties)) { - w[key] = value; - } - } addWallet(w); await saveToDisk(); A(A.ENUM.CREATED_WALLET); @@ -92,10 +86,9 @@ function WalletImport() { /** * * @param importText - * @param additionalProperties key-values passed from outside. Used only to set up `masterFingerprint` property for watch-only wallet * @returns {Promise} */ - WalletImport.processImportText = async (importText, additionalProperties) => { + WalletImport.processImportText = async importText => { IdleTimerManager.setIdleTimerDisabled(true); // Plan: // -2. check if BIP38 encrypted @@ -232,7 +225,7 @@ function WalletImport() { watchOnly.setSecret(importText); if (watchOnly.valid()) { await watchOnly.fetchBalance(); - return WalletImport._saveWallet(watchOnly, additionalProperties); + return WalletImport._saveWallet(watchOnly); } // nope, not watch-only diff --git a/screen/send/ScanQRCode.js b/screen/send/ScanQRCode.js index 1d0dd5505..b1129cea7 100644 --- a/screen/send/ScanQRCode.js +++ b/screen/send/ScanQRCode.js @@ -229,11 +229,7 @@ const ScanQRCode = () => { if (launchedBy) { navigation.navigate(launchedBy); } - if (ret.additionalProperties) { - onBarScanned(ret.data, ret.additionalProperties); - } else { - onBarScanned(ret.data); - } + onBarScanned(ret.data); } catch (e) { console.log(e); } diff --git a/screen/wallets/import.js b/screen/wallets/import.js index 4c20159a7..eb8d6a014 100644 --- a/screen/wallets/import.js +++ b/screen/wallets/import.js @@ -65,9 +65,8 @@ const WalletsImport = () => { /** * * @param importText - * @param additionalProperties key-values passed from outside. Used only to set up `masterFingerprint` property for watch-only wallet */ - const importMnemonic = async (importText, additionalProperties) => { + const importMnemonic = async importText => { if (WalletImport.isCurrentlyImportingWallet()) { return; } @@ -75,7 +74,7 @@ const WalletsImport = () => { navigation.dangerouslyGetParent().pop(); await new Promise(resolve => setTimeout(resolve, 500)); // giving some time to animations try { - await WalletImport.processImportText(importText, additionalProperties); + await WalletImport.processImportText(importText); WalletImport.removePlaceholderWallet(); } catch (error) { WalletImport.removePlaceholderWallet(); @@ -89,12 +88,11 @@ const WalletsImport = () => { /** * * @param value - * @param additionalProperties key-values passed from outside. Used only to set up `masterFingerprint` property for watch-only wallet */ - const onBarScanned = (value, additionalProperties) => { + const onBarScanned = value => { if (value && value.data) value = value.data + ''; // no objects here, only strings setImportText(value); - setTimeout(() => importMnemonic(value, additionalProperties), 500); + setTimeout(() => importMnemonic(value), 500); }; const importScan = () => {