Prevent startup race conditions breaking pinned tabs sometimes.
This commit is contained in:
parent
eb4f87d660
commit
1c23d736a0
|
@ -4,13 +4,12 @@
|
||||||
let backlog = new Set();
|
let backlog = new Set();
|
||||||
|
|
||||||
let stopAndReload = beforeReloading => {
|
let stopAndReload = beforeReloading => {
|
||||||
stop();
|
debug("Should I reload? %o, now: %s", performance.now())
|
||||||
let navTimes = performance.getEntriesByType && performance.getEntriesByType("navigation")[0];
|
if (performance.now() > 10000) {
|
||||||
debug("Should I reload? %o, now: %s", navTimes, performance.now())
|
|
||||||
if (navTimes && navTimes.type === "reload" || performance.now() > 10000) {
|
|
||||||
debug("Won't reload.");
|
debug("Won't reload.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
stop();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
debug("Reloading...");
|
debug("Reloading...");
|
||||||
if (typeof beforeReloading === "function") {
|
if (typeof beforeReloading === "function") {
|
||||||
|
|
Loading…
Reference in New Issue