diff --git a/src/app/components/concurrent-stream/concurrent-stream.component.ts b/src/app/components/concurrent-stream/concurrent-stream.component.ts index 6c2cc67..e99108b 100644 --- a/src/app/components/concurrent-stream/concurrent-stream.component.ts +++ b/src/app/components/concurrent-stream/concurrent-stream.component.ts @@ -42,6 +42,11 @@ export class ConcurrentStreamComponent implements OnInit { } + ngOnDestroy(): void { + if (this.check_timeout) { clearInterval(this.check_timeout); } + if (this.update_timeout) { clearInterval(this.update_timeout); } + } + startServer() { this.started = true; this.server_started = true; diff --git a/src/app/components/twitch-chat/twitch-chat.component.ts b/src/app/components/twitch-chat/twitch-chat.component.ts index d2e0aa0..e4ec4c7 100644 --- a/src/app/components/twitch-chat/twitch-chat.component.ts +++ b/src/app/components/twitch-chat/twitch-chat.component.ts @@ -33,7 +33,8 @@ export class TwitchChatComponent implements OnInit, AfterViewInit { this.getFullChat(); } - ngAfterViewInit() { + ngOnDestroy(): void { + if (this.chat_check_interval_obj) { clearInterval(this.chat_check_interval_obj); } } private isUserNearBottom(): boolean { diff --git a/src/app/subscription/subscription/subscription.component.ts b/src/app/subscription/subscription/subscription.component.ts index dcb6c5c..967b5bd 100644 --- a/src/app/subscription/subscription/subscription.component.ts +++ b/src/app/subscription/subscription/subscription.component.ts @@ -52,6 +52,8 @@ export class SubscriptionComponent implements OnInit, OnDestroy { this.route.params.subscribe(params => { this.id = params['id']; + if (this.sub_interval) { clearInterval(this.sub_interval); } + this.postsService.service_initialized.subscribe(init => { if (init) { this.getConfig();