Skip to content

Commit a9214c5

Browse files
Chau TranChau Tran
Chau Tran
authored and
Chau Tran
committed
fix(core): adjust safe detect changes
1 parent f5efc4e commit a9214c5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

libs/angular-three/src/lib/utils/safe-detect-changes.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import type { NgtAnyRecord } from '../types';
44
export function safeDetectChanges(cdr: ChangeDetectorRef | undefined | null) {
55
if (!cdr) return;
66
try {
7-
// dynamic created component with ViewContainerRef#createComponent does not have Context
8-
// but it has _attachedToViewContainer
9-
if ((cdr as NgtAnyRecord)['context'] || (cdr as NgtAnyRecord)['_attachedToViewContainer']) {
7+
if ((cdr as NgtAnyRecord)['_attachedToViewContainer']) {
108
cdr.detectChanges();
119
}
1210
} catch (e) {

0 commit comments

Comments
 (0)