fix(web): stabilize local sign-in and page lifecycle handling

This commit is contained in:
Boki 2026-10-25 11:31:42 -04:00
parent 3a290cc8a7
commit 0874e44c12
7 changed files with 79 additions and 17 deletions

View file

@ -2,15 +2,16 @@ import { browserLog } from '@/utils/browserLog';
// Global error handler for chart disposal errors
export function setupChartErrorHandler() {
// Only suppress chart disposal errors during page unload
// pagehide works with back/forward caching and documents that disallow unload.
// Restore normal reporting if the browser later restores this same document.
let isUnloading = false;
window.addEventListener('beforeunload', () => {
window.addEventListener('pagehide', () => {
isUnloading = true;
});
window.addEventListener('unload', () => {
isUnloading = true;
window.addEventListener('pageshow', () => {
isUnloading = false;
});
// Intercept console errors for chart disposal