Skip to content

Commit

Permalink
fix: window object can only be used on browser side
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisie96 authored and shauke committed Jun 3, 2022
1 parent f8cf5c1 commit cd4ddff
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isPlatformServer } from '@angular/common';
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
import { Inject, Injectable, PLATFORM_ID } from '@angular/core';
import { Actions, createEffect } from '@ngrx/effects';
import { Store, select } from '@ngrx/store';
Expand All @@ -24,7 +24,7 @@ export class TrackingConfigEffects {
store: Store,
cookiesService: CookiesService
) {
if (cookiesService.cookieConsentFor('tracking')) {
if (isPlatformBrowser(this.platformId) && cookiesService.cookieConsentFor('tracking')) {
store
.pipe(
select(getGTMToken),
Expand Down

0 comments on commit cd4ddff

Please sign in to comment.