From 84bcee3d2b695e8fc6158c264ca1774d4f546fef Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 3 Apr 2023 23:04:04 +0200 Subject: Generate JSON for replay view in SQL. Also optimize the format by not JSON encoding some data twice. --- public/common/play.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'public') diff --git a/public/common/play.js b/public/common/play.js index dce1573..bb3c5ae 100644 --- a/public/common/play.js +++ b/public/common/play.js @@ -825,8 +825,6 @@ async function init_replay() { let ss for (p = 0; p < replay.length; ++p) { - replay[p][2] = JSON.parse(replay[p][2]) - if (rules.is_checkpoint) { replay[p].is_checkpoint = p > 1 && rules.is_checkpoint(ss, s) ss = object_copy(s) @@ -1009,7 +1007,7 @@ async function init_replay() { window.addEventListener("hashchange", on_hash_change) } else { console.log("REPLAY NOT AVAILABLE") - s = JSON.parse(body.state) + s = body.state update_replay_view() } } -- cgit v1.2.3