mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-07 18:45:09 +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 { 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 { Router } from '@angular/router'
|
||||||
|
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
@@ -14,7 +14,7 @@ import { SelectionService } from '../../../core/services/selection.service'
|
|||||||
templateUrl: './result-table.component.html',
|
templateUrl: './result-table.component.html',
|
||||||
standalone: false,
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class ResultTableComponent implements OnInit {
|
export class ResultTableComponent implements OnInit, OnDestroy {
|
||||||
@HostBinding('class.contents') contents = true
|
@HostBinding('class.contents') contents = true
|
||||||
|
|
||||||
@Output() rowClicked = new EventEmitter<ChartData[]>()
|
@Output() rowClicked = new EventEmitter<ChartData[]>()
|
||||||
@@ -125,4 +125,8 @@ export class ResultTableComponent implements OnInit {
|
|||||||
this.viewport.checkViewportSize()
|
this.viewport.checkViewportSize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnDestroy(): void {
|
||||||
|
this.subscription.forEach(sub => sub.unsubscribe())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user