FIX: Only send wallets to watch app if installed

This commit is contained in:
Marcos Rodriguez Vélez 2020-09-14 14:10:25 -04:00 committed by Overtorment
parent 84b78da934
commit ce0002a0f9

View file

@ -51,6 +51,8 @@ const WatchConnectivity = () => {
}; };
WatchConnectivity.sendWalletsToWatch = () => { WatchConnectivity.sendWalletsToWatch = () => {
getIsWatchAppInstalled().then(installed => {
if (!installed) return;
const BlueApp = require('./BlueApp'); const BlueApp = require('./BlueApp');
const allWallets = BlueApp.getWallets(); const allWallets = BlueApp.getWallets();
if (!Array.isArray(allWallets)) { if (!Array.isArray(allWallets)) {
@ -156,6 +158,7 @@ WatchConnectivity.sendWalletsToWatch = () => {
updateApplicationContext({ wallets, randomID: Math.floor(Math.random() * 11) }); updateApplicationContext({ wallets, randomID: Math.floor(Math.random() * 11) });
return { wallets }; return { wallets };
}); });
});
}; };
export default WatchConnectivity; export default WatchConnectivity;
WatchConnectivity(); WatchConnectivity();