fix: 游戏展示页轮询改为无条件启动——脚本注入时bricks.app可能未就绪导致轮询永不启动

This commit is contained in:
agent.develop 2026-08-30 21:36:46 +08:00
parent f197d31e93
commit 4c6c3037a3

View File

@ -77,14 +77,14 @@ window.scenseGameList = (function () {
})();
(function () {
// hub 内 urlwidget 懒构建:容器元素在 tab 激活后才存在,轮询等容器出现再渲染
// hub 内 urlwidget 懒构建:容器元素在 tab 激活后才存在;
// 且本脚本注入时 bricks.app 可能尚未就绪——无条件轮询等容器出现再渲染
function tryLoad(retries) {
if (!window.scenseGameList) return;
var box = document.getElementById('scense_session_list');
if (box) { window.scenseGameList.load(); return; }
if (window.scenseGameList) {
var box = document.getElementById('scense_session_list');
if (box) { window.scenseGameList.load(); return; }
}
if (retries > 0) setTimeout(function () { tryLoad(retries - 1); }, 500);
}
if (window.bricks && window.bricks.app) {
setTimeout(function () { tryLoad(120); }, 300);
}
setTimeout(function () { tryLoad(240); }, 300);
})();