mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-20 14:05:27 +01:00
FIX: Fixed WatchConnectivity undefined array log issue
This commit is contained in:
parent
001b814da1
commit
9dd9fb6b97
2 changed files with 10 additions and 8 deletions
|
@ -32,7 +32,7 @@ export default class WatchConnectivity {
|
|||
);
|
||||
reply({ invoicePaymentRequest: createInvoiceRequest });
|
||||
} else if (message.message === 'sendApplicationContext') {
|
||||
await WatchConnectivity.shared.sendWalletsToWatch(WatchConnectivity.shared.wallets);
|
||||
await WatchConnectivity.shared.sendWalletsToWatch();
|
||||
} else if (message.message === 'fetchTransactions') {
|
||||
await WatchConnectivity.shared.fetchTransactionsFunction();
|
||||
}
|
||||
|
@ -56,14 +56,16 @@ export default class WatchConnectivity {
|
|||
}
|
||||
}
|
||||
|
||||
async sendWalletsToWatch(allWallets) {
|
||||
if (allWallets === undefined && WatchConnectivity.shared.wallets !== undefined) {
|
||||
allWallets = WatchConnectivity.shared.wallets;
|
||||
}
|
||||
if (allWallets && allWallets.length === 0) {
|
||||
async sendWalletsToWatch() {
|
||||
const allWallets = WatchConnectivity.shared.wallets;
|
||||
if (!Array.isArray(allWallets)) {
|
||||
console.log('No Wallets set to sync with Watch app. Exiting...');
|
||||
return;
|
||||
} else if (allWallets.length === 0) {
|
||||
console.log('Wallets array is set. No Wallets set to sync with Watch app. Exiting...');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Wallets set to sync with Watch app. Continuing...');
|
||||
return InteractionManager.runAfterInteractions(async () => {
|
||||
if (WatchConnectivity.shared.isAppInstalled) {
|
||||
let wallets = [];
|
||||
|
|
|
@ -253,7 +253,7 @@ export class AppStorage {
|
|||
await this.fetchWalletTransactions();
|
||||
await this.saveToDisk();
|
||||
};
|
||||
await WatchConnectivity.shared.sendWalletsToWatch(this.wallets);
|
||||
await WatchConnectivity.shared.sendWalletsToWatch();
|
||||
DeviceQuickActions.setWallets(this.wallets);
|
||||
DeviceQuickActions.setQuickActions();
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue