foundation: resolve platform in injection context for dot background teardown
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,6 +21,7 @@ export class DotBackground implements OnDestroy {
|
||||
|
||||
private readonly ngZone = inject(NgZone);
|
||||
private readonly coarsePointer = prefersCoarsePointer();
|
||||
private readonly isBrowser = isBrowserPlatform();
|
||||
|
||||
private ctx: CanvasRenderingContext2D | undefined;
|
||||
private dots: Dot[] = [];
|
||||
@@ -50,7 +51,7 @@ export class DotBackground implements OnDestroy {
|
||||
|
||||
cancelAnimationFrame(this.animationId);
|
||||
|
||||
if (isBrowserPlatform()) {
|
||||
if (this.isBrowser) {
|
||||
window.removeEventListener('resize', this.resize);
|
||||
window.removeEventListener('mousemove', this.onMouseMove);
|
||||
window.removeEventListener('click', this.onMouseClick);
|
||||
|
||||
Reference in New Issue
Block a user