fix(web): show retry when Flutter loading fails #12
2 changed files with 12 additions and 1 deletions
|
|
@ -33,5 +33,12 @@
|
||||||
|
|
||||||
hesabixStartFlutter().catch(function (e) {
|
hesabixStartFlutter().catch(function (e) {
|
||||||
console.error('[Hesabix] Flutter bootstrap failed:', e);
|
console.error('[Hesabix] Flutter bootstrap failed:', e);
|
||||||
|
var loaderUi = window.__hesabixLoaderUI;
|
||||||
|
if (loaderUi && typeof loaderUi.markSlowLoad === 'function') {
|
||||||
|
loaderUi.markSlowLoad();
|
||||||
|
}
|
||||||
|
if (loaderUi && typeof loaderUi.showRetry === 'function') {
|
||||||
|
loaderUi.showRetry();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,7 @@
|
||||||
setStatus: setStatus,
|
setStatus: setStatus,
|
||||||
setStatusKey: setStatusKey,
|
setStatusKey: setStatusKey,
|
||||||
markSlowLoad: markSlowLoad,
|
markSlowLoad: markSlowLoad,
|
||||||
|
showRetry: showRetry,
|
||||||
hide: hideLoadingScreen,
|
hide: hideLoadingScreen,
|
||||||
t: t,
|
t: t,
|
||||||
detectLocale: detectLocale,
|
detectLocale: detectLocale,
|
||||||
|
|
@ -400,7 +401,10 @@
|
||||||
var screen = document.getElementById('flutter-loading-screen');
|
var screen = document.getElementById('flutter-loading-screen');
|
||||||
if (screen && !screen.classList.contains('hidden') && !appReadySignaled) {
|
if (screen && !screen.classList.contains('hidden') && !appReadySignaled) {
|
||||||
console.warn('[Hesabix] Loader fallback timeout');
|
console.warn('[Hesabix] Loader fallback timeout');
|
||||||
hideLoadingScreen();
|
// Flutter may still be compiling or initializing. Keep the loader visible
|
||||||
|
// instead of exposing the intentionally empty web loading widget.
|
||||||
|
markSlowLoad();
|
||||||
|
showRetry();
|
||||||
}
|
}
|
||||||
}, 120000);
|
}, 120000);
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue