|
@ -1,3 +1,4 @@ |
|
|
|
|
|
/* global alert */ |
|
|
import QuickActions from 'react-native-quick-actions'; |
|
|
import QuickActions from 'react-native-quick-actions'; |
|
|
|
|
|
|
|
|
export default class DeviceQuickActions { |
|
|
export default class DeviceQuickActions { |
|
@ -11,21 +12,25 @@ export default class DeviceQuickActions { |
|
|
if (!wallets) { |
|
|
if (!wallets) { |
|
|
wallets = BlueApp.getWallets(); |
|
|
wallets = BlueApp.getWallets(); |
|
|
} |
|
|
} |
|
|
if (supported && error === null) { |
|
|
if (error) { |
|
|
let shortcutItems = []; |
|
|
alert(error); |
|
|
for (const wallet of wallets) { |
|
|
} else { |
|
|
shortcutItems.push({ |
|
|
if (supported) { |
|
|
type: 'Wallets', // Required
|
|
|
let shortcutItems = []; |
|
|
title: wallet.getLabel(), // Optional, if empty, `type` will be used instead
|
|
|
for (const wallet of wallets) { |
|
|
subtitle: wallet.hideBalance |
|
|
shortcutItems.push({ |
|
|
? '' |
|
|
type: 'Wallets', // Required
|
|
|
: `${loc.formatBalance(Number(wallet.getBalance()), wallet.getPreferredBalanceUnit(), true)}`, |
|
|
title: wallet.getLabel(), // Optional, if empty, `type` will be used instead
|
|
|
userInfo: { |
|
|
subtitle: wallet.hideBalance |
|
|
url: `bluewallet://wallet/${wallet.getID()}`, // Provide any custom data like deep linking URL
|
|
|
? '' |
|
|
}, |
|
|
: `${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); |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|