Browse Source

Always patch operations if some contained `blockHeight: null`

closes #1000
master
meriadec 7 years ago
parent
commit
55d72abcd7
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 3
      src/bridge/LibcoreBridge.js

3
src/bridge/LibcoreBridge.js

@ -28,6 +28,8 @@ type Transaction = {
const decodeOperation = (encodedAccount, rawOp) => const decodeOperation = (encodedAccount, rawOp) =>
decodeAccount({ ...encodedAccount, operations: [rawOp] }).operations[0] decodeAccount({ ...encodedAccount, operations: [rawOp] }).operations[0]
const hadSomeNullBlockHeight = ops => ops.some(op => op.blockHeight === null)
const EditFees = ({ account, onChange, value }: EditProps<Transaction>) => ( const EditFees = ({ account, onChange, value }: EditProps<Transaction>) => (
<FeesBitcoinKind <FeesBitcoinKind
onChange={feePerByte => { onChange={feePerByte => {
@ -135,6 +137,7 @@ const LibcoreBridge: WalletBridge<Transaction> = {
const hasChanged = const hasChanged =
accountOps.length !== syncedOps.length || // size change, we do a full refresh for now... accountOps.length !== syncedOps.length || // size change, we do a full refresh for now...
hadSomeNullBlockHeight(accountOps) || // a bit berzerk, but in the future we will want to patch ops 1 by 1
(accountOps.length > 0 && (accountOps.length > 0 &&
syncedOps.length > 0 && syncedOps.length > 0 &&
(accountOps[0].accountId !== syncedOps[0].accountId || (accountOps[0].accountId !== syncedOps[0].accountId ||

Loading…
Cancel
Save