From 13edf10c0c8c94caf9f32f57c633519d6a4420fb Mon Sep 17 00:00:00 2001 From: t123yh Date: Tue, 22 Aug 2017 15:56:36 +0800 Subject: [PATCH] Fix roughData incorrect assignment. --- views/submission_content.ejs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/views/submission_content.ejs b/views/submission_content.ejs index fc4c0f4..59c8aa5 100644 --- a/views/submission_content.ejs +++ b/views/submission_content.ejs @@ -55,12 +55,12 @@ @@ -212,9 +212,10 @@ if (token != null) { vueApp.roughData.running = true; }); socket.on('update', (p) => { - console.log("Updating"); - console.log("Delta: " + JSON.stringify(p)); - jsondiffpatch.patch(vueApp.detailResult, p.delta); + // console.log("Delta: " + JSON.stringify(p)); + const current = JSON.parse(JSON.stringify(vueApp.detailResult)); + jsondiffpatch.patch(current, p.delta); + vueApp.detailResult = current; }); socket.on('finish', (p) => { vueApp.roughData.running = false; @@ -224,7 +225,7 @@ if (token != null) { socket.emit('join', token, (data) => { if (data && data.ok) { if (data.finished) { - vueApp.roughData = data.roughResult; + vueApp.roughData.result = data.roughResult; vueApp.detailData = data.result || { systemMessage: "系统出错,请刷新后重试。" };