Skip to content
Snippets Groups Projects
Commit 7f7c1973 authored by Xiao Gui's avatar Xiao Gui
Browse files

chore: ondestroy cleanup

parent c5f725eb
No related branches found
No related tags found
No related merge requests found
......@@ -36,13 +36,14 @@ export class UserAnnotationsComponent implements OnInit, OnDestroy {
private subscription: Subscription[] = []
private onDestroyCb: (() => void )[] = []
private get viewer(){
return (window as any).viewer
}
ngOnDestroy(): void {
while(this.onDestroyCb.length) this.onDestroyCb.pop()()
while(this.subscription.length) this.subscription.pop().unsubscribe()
if (!this.viewer) {
throw new Error(`this.viewer is undefined`)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment