mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-09 05:09:39 +00:00
Fix missing unsubscribe
prevent potential performance issue when switching tabs too many times.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'
|
||||
import { Component, EventEmitter, HostBinding, HostListener, OnInit, Output, ViewChild } from '@angular/core'
|
||||
import { Component, EventEmitter, HostBinding, HostListener, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
|
||||
import { Router } from '@angular/router'
|
||||
|
||||
import { Subscription } from 'rxjs'
|
||||
@@ -14,7 +14,7 @@ import { SelectionService } from '../../../core/services/selection.service'
|
||||
templateUrl: './result-table.component.html',
|
||||
standalone: false,
|
||||
})
|
||||
export class ResultTableComponent implements OnInit {
|
||||
export class ResultTableComponent implements OnInit, OnDestroy {
|
||||
@HostBinding('class.contents') contents = true
|
||||
|
||||
@Output() rowClicked = new EventEmitter<ChartData[]>()
|
||||
@@ -125,4 +125,8 @@ export class ResultTableComponent implements OnInit {
|
||||
this.viewport.checkViewportSize()
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.subscription.forEach(sub => sub.unsubscribe())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user