Changeset View
Changeset View
Standalone View
Standalone View
cashtab/src/components/AppModes/Extension.js
Show All 24 Lines | const getObjectFromExtensionStorage = async function (key) { | ||||
reject(err); | reject(err); | ||||
} | } | ||||
}); | }); | ||||
}; | }; | ||||
const copyAddressToExtensionStorage = async wallet => { | const copyAddressToExtensionStorage = async wallet => { | ||||
// Get address from active wallet | // Get address from active wallet | ||||
let address; | let address; | ||||
try { | try { | ||||
address = wallet.paths.find( | address = wallet.paths.get(1899).address; | ||||
pathInfo => pathInfo.path === 1899, | |||||
).address; | |||||
console.log(`Address fetched from extension`, address); | console.log(`Address fetched from extension`, address); | ||||
} catch (err) { | } catch (err) { | ||||
// The wallet object can be 'false' when Cashtab first loads. In this case, we want this function to do nothing. | // The wallet object can be 'false' when Cashtab first loads. In this case, we want this function to do nothing. | ||||
return console.log( | return console.log( | ||||
`Wallet not loaded yet, exiting copyAddressToExtension`, | `Wallet not loaded yet, exiting copyAddressToExtension`, | ||||
); | ); | ||||
} | } | ||||
// Save the address to extension storage API | // Save the address to extension storage API | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |