Skip to content

Commit

Permalink
fix: condition for gatsby build (#605)
Browse files Browse the repository at this point in the history
* fix: condition for gatsby build

* fix: remove pack
  • Loading branch information
lauti7 authored Mar 27, 2024
1 parent 2de8d8e commit 4038fd4
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/modules/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,22 @@ export class NotificationsAPI extends BaseClient {
const ONBOARDING_KEY = "dcl_notifications_onboarding"

export const checkIsOnboarding = () => {
const isOnboarding = localStorage.getItem(ONBOARDING_KEY)
if (isOnboarding) {
const value = JSON.parse(isOnboarding)
return value
} else {
localStorage.setItem(ONBOARDING_KEY, "true")
return true
if (typeof window !== "undefined") {
const isOnboarding = localStorage.getItem(ONBOARDING_KEY)
if (isOnboarding) {
const value = JSON.parse(isOnboarding)
return value
} else {
localStorage.setItem(ONBOARDING_KEY, "true")
return true
}
}
}

export const setOnboardingDone = () => {
localStorage.setItem(ONBOARDING_KEY, "false")
if (typeof window !== "undefined") {
localStorage.setItem(ONBOARDING_KEY, "false")
}
}

const parseNotification = (notification: DCLNotification): DCLNotification => {
Expand Down

0 comments on commit 4038fd4

Please sign in to comment.