summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-03 23:04:04 +0200
committerTor Andersson <tor@ccxvii.net>2023-04-18 10:06:13 +0200
commit84bcee3d2b695e8fc6158c264ca1774d4f546fef (patch)
tree540d3b653190612f1c2b2aab580d82019afbe3c2 /public
parent58d8b4e1fec0692bbc78db73c54385f5efbe3e8f (diff)
downloadserver-84bcee3d2b695e8fc6158c264ca1774d4f546fef.tar.gz
Generate JSON for replay view in SQL.
Also optimize the format by not JSON encoding some data twice.
Diffstat (limited to 'public')
-rw-r--r--public/common/play.js4
1 files changed, 1 insertions, 3 deletions
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()
}
}