Skip to content

Commit

Permalink
TST
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosrdz committed Nov 10, 2019
1 parent a4ae836 commit bcdf62e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions class/app-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class AppStorage {
this.tx_metadata = data.tx_metadata;
}
}
DeviceQuickActions.setQuickActions(this.wallets);
await DeviceQuickActions.setQuickActions(this.wallets);
WatchConnectivity.init();
WatchConnectivity.shared && (await WatchConnectivity.shared.sendWalletsToWatch());
return true;
Expand Down Expand Up @@ -323,7 +323,7 @@ export class AppStorage {
}
WatchConnectivity.init();
WatchConnectivity.shared && WatchConnectivity.shared.sendWalletsToWatch();
DeviceQuickActions.setQuickActions(this.wallets);
await DeviceQuickActions.setQuickActions(this.wallets);
return this.setItem('data', JSON.stringify(data));
}

Expand Down
33 changes: 19 additions & 14 deletions class/quickActions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global alert */
import QuickActions from 'react-native-quick-actions';

export default class DeviceQuickActions {
Expand All @@ -11,21 +12,25 @@ export default class DeviceQuickActions {
if (!wallets) {
wallets = BlueApp.getWallets();
}
if (supported && error === null) {
let shortcutItems = [];
for (const wallet of wallets) {
shortcutItems.push({
type: 'Wallets', // Required
title: wallet.getLabel(), // Optional, if empty, `type` will be used instead
subtitle: wallet.hideBalance
? ''
: `${loc.formatBalance(Number(wallet.getBalance()), wallet.getPreferredBalanceUnit(), true)}`,
userInfo: {
url: `bluewallet://wallet/${wallet.getID()}`, // Provide any custom data like deep linking URL
},
});
if (error) {
alert(error);
} else {
if (supported) {
let shortcutItems = [];
for (const wallet of wallets) {
shortcutItems.push({
type: 'Wallets', // Required
title: wallet.getLabel(), // Optional, if empty, `type` will be used instead
subtitle: wallet.hideBalance
? ''
: `${loc.formatBalance(Number(wallet.getBalance()), wallet.getPreferredBalanceUnit(), true)}`,
userInfo: {
url: `bluewallet://wallet/${wallet.getID()}`, // Provide any custom data like deep linking URL
},
});
}
QuickActions.setShortcutItems(shortcutItems);
}
QuickActions.setShortcutItems(shortcutItems);
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function setPrefferedCurrency(item) {
await DefaultPreference.setName('group.io.bluewallet.bluewallet');
await DefaultPreference.set('preferredCurrency', item.endPointKey);
await DefaultPreference.set('preferredCurrencyLocale', item.locale.replace('-', '_'));
DeviceQuickActions.setQuickActions();
await DeviceQuickActions.setQuickActions();
}

async function getPreferredCurrency() {
Expand Down Expand Up @@ -66,7 +66,7 @@ async function updateExchangeRate() {
exchangeRates['BTC_' + preferredFiatCurrency.endPointKey] = json.bpi[preferredFiatCurrency.endPointKey].rate_float * 1;
await AsyncStorage.setItem(AppStorage.EXCHANGE_RATES, JSON.stringify(exchangeRates));
await AsyncStorage.setItem(AppStorage.PREFERRED_CURRENCY, JSON.stringify(preferredFiatCurrency));
DeviceQuickActions.setQuickActions();
await DeviceQuickActions.setQuickActions();
}

let interval = false;
Expand Down

0 comments on commit bcdf62e

Please sign in to comment.