foundation: resolve platform in injection context for dot background teardown

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-25 17:12:10 +02:00
parent 42e9f01253
commit 9ea2885c7b
3 changed files with 28 additions and 1 deletions

View File

@@ -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);