avoid iphone jank:

safari can immediately popstate when alt-tabbing back to the browser,
causing the page to load twice in parallel:

2174 log-capture ok
2295 h-repl $location
2498 h-pop $location <==
2551 sha-ok  # from initial load
This commit is contained in:
ed 2023-10-15 11:27:27 +00:00
parent 2df76eb6e1
commit edbafd94c2

View file

@ -3042,6 +3042,8 @@ function scan_hash(v) {
function eval_hash() { function eval_hash() {
window.onpopstate = treectl.onpopfun;
var v = hash0; var v = hash0;
hash0 = null; hash0 = null;
if (!v) if (!v)
@ -6170,7 +6172,7 @@ var treectl = (function () {
if (cs == 'tree' || (cs != 'na' && vw >= 60)) if (cs == 'tree' || (cs != 'na' && vw >= 60))
r.entree(null, true); r.entree(null, true);
window.onpopstate = function (e) { r.onpopfun = function (e) {
console.log("h-pop " + e.state); console.log("h-pop " + e.state);
if (!e.state) if (!e.state)
return; return;