From: Ian Jackson Date: Fri, 2 Apr 2021 23:04:01 +0000 (+0100) Subject: js: Do not unconditionally set gen_update_hook X-Git-Tag: otter-0.5.0~294 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9d9ed8b8ba870b20f28f0d8103d96ee922f8900a;p=otter.git js: Do not unconditionally set gen_update_hook When we reload, can bust the tests, as the hook gets overwritten. I think. Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index a2db2305..7694abf8 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -119,7 +119,7 @@ var keyops_local : { [opname: string]: (uo: UoRecord) => void } = Object(); var last_log_ts: wasm_bindgen.TimestampAbbreviator; var last_zoom_factor : number = 1.0; var firefox_bug_zoom_factor_compensation : number = 1.0; -var gen_update_hook : () => void = function() { } +var gen_update_hook : () => void; var svg_ns : string; var space : SVGGraphicsElement; @@ -1450,6 +1450,8 @@ function startup() { redisplay_ancillaries(piece,p); } + if (gen_update_hook == null) gen_update_hook = function() { }; + last_log_ts = wasm_bindgen.timestamp_abbreviator(dataload.last_log_ts); var es = new EventSource(