From a99fbe04136ec623d7c5d71598856ef1cd2b9fe0 Mon Sep 17 00:00:00 2001 From: meriadec Date: Wed, 11 Jul 2018 22:06:53 +0200 Subject: [PATCH] Update operation sync patch condition --- src/bridge/LibcoreBridge.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bridge/LibcoreBridge.js b/src/bridge/LibcoreBridge.js index d4beb761..6ea7ff24 100644 --- a/src/bridge/LibcoreBridge.js +++ b/src/bridge/LibcoreBridge.js @@ -28,8 +28,6 @@ type Transaction = { const decodeOperation = (encodedAccount, rawOp) => decodeAccount({ ...encodedAccount, operations: [rawOp] }).operations[0] -const hadSomeNullBlockHeight = ops => ops.some(op => op.blockHeight === null) - const EditFees = ({ account, onChange, value }: EditProps) => ( { @@ -137,11 +135,11 @@ const LibcoreBridge: WalletBridge = { const hasChanged = 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 && syncedOps.length > 0 && (accountOps[0].accountId !== syncedOps[0].accountId || - accountOps[0].id !== syncedOps[0].id)) // if same size, only check if the last item has changed. + accountOps[0].id !== syncedOps[0].id || // if same size, only check if the last item has changed. + accountOps[0].blockHeight !== syncedOps[0].blockHeight)) if (hasChanged) { patch.operations = syncedAccount.operations