From d29b5f10ef5137ab56ecc9615e5e894082db9803 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 2 Oct 2017 13:14:42 -0700 Subject: tx state history - fix bug where initial snapshot was mutated on updateTx --- app/scripts/lib/tx-state-history-helper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/scripts/lib/tx-state-history-helper.js') diff --git a/app/scripts/lib/tx-state-history-helper.js b/app/scripts/lib/tx-state-history-helper.js index 304069d57..5ebd78689 100644 --- a/app/scripts/lib/tx-state-history-helper.js +++ b/app/scripts/lib/tx-state-history-helper.js @@ -24,7 +24,8 @@ function generateHistoryEntry(previousState, newState) { return jsonDiffer.compare(previousState, newState) } -function replayHistory(shortHistory) { +function replayHistory(_shortHistory) { + const shortHistory = clone(_shortHistory) return shortHistory.reduce((val, entry) => jsonDiffer.applyPatch(val, entry).newDocument) } -- cgit