From 3d4533802815b09eb149ccbbcb38ac02d73352c6 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 20:22:21 +0000 Subject: [PATCH] Add isPlatformBrowser check, load particles on bro --- .../projects/ng-particles/src/lib/ng-particles.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/particles/projects/ng-particles/src/lib/ng-particles.component.ts b/components/particles/projects/ng-particles/src/lib/ng-particles.component.ts index 5280dbd..1dc5ddb 100644 --- a/components/particles/projects/ng-particles/src/lib/ng-particles.component.ts +++ b/components/particles/projects/ng-particles/src/lib/ng-particles.component.ts @@ -9,7 +9,7 @@ import { Output, PLATFORM_ID, } from '@angular/core'; -import { isPlatformServer } from '@angular/common'; +import { isPlatformServer, isPlatformBrowser } from '@angular/common'; import { from, mergeMap, Subject, Subscription, takeUntil } from 'rxjs'; import { tsParticles } from '@tsparticles/engine'; import type { Container, Engine } from '@tsparticles/engine'; @@ -46,10 +46,10 @@ export class NgxParticlesComponent implements OnInit, AfterViewInit, OnDestroy { } public ngAfterViewInit(): void { - if (isPlatformServer(this.platformId)) { + if (!isPlatformBrowser(this.platformId)) { return; } - + this.loadParticles(); }