Browse Source

fix flow

master
Gaëtan Renaudeau 7 years ago
parent
commit
1e2aa3cf2f
  1. 13
      src/commands/libcoreScanAccounts.js
  2. 2
      src/helpers/libcore.js

13
src/commands/libcoreScanAccounts.js

@ -21,8 +21,17 @@ const cmd: Command<Input, Result> = createCommand(
scanAccountsOnDevice({ scanAccountsOnDevice({
devicePath, devicePath,
currencyId, currencyId,
onAccountScanned: account => o.next(account), onAccountScanned: account => {
}).then(() => o.complete(), e => o.error(e)) o.next(account)
},
}).then(
() => {
o.complete()
},
e => {
o.error(e)
},
)
function unsubscribe() { function unsubscribe() {
// FIXME not implemented // FIXME not implemented

2
src/helpers/libcore.js

@ -18,7 +18,7 @@ import type { NJSAccount, NJSOperation } from '@ledgerhq/ledger-core/src/ledgerc
type Props = { type Props = {
devicePath: string, devicePath: string,
currencyId: string, currencyId: string,
onAccountScanned: AccountRaw => *, onAccountScanned: AccountRaw => void,
} }
export function scanAccountsOnDevice(props: Props): Promise<AccountRaw[]> { export function scanAccountsOnDevice(props: Props): Promise<AccountRaw[]> {

Loading…
Cancel
Save