fix(web): stabilize local sign-in and page lifecycle handling
This commit is contained in:
parent
3a290cc8a7
commit
0874e44c12
7 changed files with 79 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue