website refactor
This commit is contained in:
@@ -230,7 +230,7 @@ export class GlobalErrorHandler {
|
||||
private setupReactErrorHandling(): void {
|
||||
// This will be used by React Error Boundaries
|
||||
// We'll provide a global registry for React errors
|
||||
(window as any).__GRIDPILOT_REACT_ERRORS__ = [];
|
||||
(window as { __GRIDPILOT_REACT_ERRORS__?: unknown[] }).__GRIDPILOT_REACT_ERRORS__ = [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -254,14 +254,14 @@ export class GlobalErrorHandler {
|
||||
width: window.screen.width,
|
||||
height: window.screen.height,
|
||||
},
|
||||
memory: (performance as any).memory ? {
|
||||
usedJSHeapSize: (performance as any).memory.usedJSHeapSize,
|
||||
totalJSHeapSize: (performance as any).memory.totalJSHeapSize,
|
||||
memory: (performance as unknown as { memory?: { usedJSHeapSize: number; totalJSHeapSize: number } }).memory ? {
|
||||
usedJSHeapSize: (performance as unknown as { memory: { usedJSHeapSize: number; totalJSHeapSize: number } }).memory.usedJSHeapSize,
|
||||
totalJSHeapSize: (performance as unknown as { memory: { usedJSHeapSize: number; totalJSHeapSize: number } }).memory.totalJSHeapSize,
|
||||
} : null,
|
||||
connection: (navigator as any).connection ? {
|
||||
effectiveType: (navigator as any).connection.effectiveType,
|
||||
downlink: (navigator as any).connection.downlink,
|
||||
rtt: (navigator as any).connection.rtt,
|
||||
connection: (navigator as unknown as { connection?: { effectiveType: string; downlink: number; rtt: number } }).connection ? {
|
||||
effectiveType: (navigator as unknown as { connection: { effectiveType: string; downlink: number; rtt: number } }).connection.effectiveType,
|
||||
downlink: (navigator as unknown as { connection: { effectiveType: string; downlink: number; rtt: number } }).connection.downlink,
|
||||
rtt: (navigator as unknown as { connection: { effectiveType: string; downlink: number; rtt: number } }).connection.rtt,
|
||||
} : null,
|
||||
...additionalContext,
|
||||
enhancedStack: this.options.captureEnhancedStacks ? this.enhanceStackTrace(stack) : undefined,
|
||||
@@ -467,8 +467,8 @@ export class GlobalErrorHandler {
|
||||
window.removeEventListener('unhandledrejection', this.handleUnhandledRejection);
|
||||
|
||||
// Restore original console.error
|
||||
if ((console as any)._originalError) {
|
||||
console.error = (console as any)._originalError;
|
||||
if ((console as unknown as { _originalError?: typeof console.error })._originalError) {
|
||||
console.error = (console as unknown as { _originalError: typeof console.error })._originalError;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user