From 567683f8035f8b95c04d8a915384d54231f1e2fa Mon Sep 17 00:00:00 2001 From: cipchk Date: Fri, 12 Apr 2024 21:29:55 +0800 Subject: [PATCH] fix(abc:notice-icon): fix incorrect unsubscription --- packages/abc/notice-icon/notice-icon.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/abc/notice-icon/notice-icon.component.ts b/packages/abc/notice-icon/notice-icon.component.ts index 834377f82..d7af780d8 100644 --- a/packages/abc/notice-icon/notice-icon.component.ts +++ b/packages/abc/notice-icon/notice-icon.component.ts @@ -52,7 +52,7 @@ import { NoticeIconSelect, NoticeItem } from './notice-icon.types'; export class NoticeIconComponent implements OnInit, OnChanges, OnDestroy { private readonly i18n = inject(DelonLocaleService); private readonly cdr = inject(ChangeDetectorRef); - private i18n$!: Subscription; + private i18n$?: Subscription; locale: LocaleData = {}; @Input() data: NoticeItem[] = []; @@ -94,6 +94,6 @@ export class NoticeIconComponent implements OnInit, OnChanges, OnDestroy { } ngOnDestroy(): void { - this.i18n$.unsubscribe(); + this.i18n$?.unsubscribe(); } }