mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 09:51:13 -05:00
feat: Implement network status banner
This commit is contained in:
@@ -98,6 +98,13 @@ export class CircuitBreaker {
|
||||
logger.info('Circuit breaker CLOSED - service recovered', {
|
||||
successCount: this.successCount
|
||||
});
|
||||
|
||||
// Emit event for UI components
|
||||
if (typeof window !== 'undefined') {
|
||||
window.dispatchEvent(new CustomEvent('circuit-breaker-closed', {
|
||||
detail: { successCount: this.successCount }
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,6 +129,16 @@ export class CircuitBreaker {
|
||||
monitoringWindow: this.config.monitoringWindow,
|
||||
resetTimeout: this.config.resetTimeout
|
||||
});
|
||||
|
||||
// Emit event for UI components
|
||||
if (typeof window !== 'undefined') {
|
||||
window.dispatchEvent(new CustomEvent('circuit-breaker-opened', {
|
||||
detail: {
|
||||
failures: this.failures.length,
|
||||
threshold: this.config.failureThreshold
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user