From bf8bdcf4bf6700eb3bd4480c58efbb38b0627c18 Mon Sep 17 00:00:00 2001 From: Lutz Roeder Date: Wed, 22 May 2024 18:35:18 -0700 Subject: [PATCH] Add layout worker (#1214) --- source/index.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/source/index.js b/source/index.js index e0d04ab794..a92177854f 100644 --- a/source/index.js +++ b/source/index.js @@ -50,21 +50,21 @@ window.exports.preload = function(callback) { var next = function() { if (modules.length === 0) { callback(); - return; - } - var ids = modules.pop(); - var resolved = ids.length; - for (var i = 0; i < ids.length; i++) { - window.exports.require(ids[i], function(module, error) { - if (error) { - callback(null, error); - return; - } - resolved--; - if (resolved === 0) { - next(); - } - }, true); + } else { + var ids = modules.pop(); + var resolved = ids.length; + for (var i = 0; i < ids.length; i++) { + window.exports.require(ids[i], function(module, error) { + if (error) { + callback(null, error); + } else { + resolved--; + if (resolved === 0) { + next(); + } + } + }, true); + } } }; next(); @@ -99,7 +99,7 @@ window.addEventListener('load', function() { } var ua = window.navigator.userAgent; var chrome = ua.match(/Chrom(e|ium)\/([0-9]+)\./); - if (Array.isArray(chrome) && parseInt(chrome[1], 10) < 80) { + if (Array.isArray(chrome) && parseInt(chrome[2], 10) < 80) { throw new Error('Please update your browser to use this application.'); } var safari = ua.match(/Version\/(\d+).*Safari/);