Skip to content

Commit

Permalink
Tidying and removing of old value (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Dec 19, 2023
1 parent e5e7de5 commit 958fec4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/posthog-persistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export class PostHogPersistence {
expire_days: number | undefined
default_expiry: number | undefined
cross_subdomain: boolean | undefined
user_state: 'anonymous' | 'identified'

constructor(config: PostHogConfig) {
// clean chars that aren't accepted by the http spec for cookie values
Expand Down Expand Up @@ -81,17 +80,13 @@ export class PostHogPersistence {
this.storage = memoryStore
} else if (storage_type === 'cookie') {
this.storage = cookieStore
} else {
} else if (localPlusCookieStore.is_supported()) {
// selected storage type wasn't supported, fallback to 'localstorage+cookie' if possible
if (localPlusCookieStore.is_supported()) {
this.storage = localPlusCookieStore
} else {
this.storage = cookieStore
}
this.storage = localPlusCookieStore
} else {
this.storage = cookieStore
}

this.user_state = 'anonymous'

this.load()
this.update_config(config)
this.save()
Expand Down

0 comments on commit 958fec4

Please sign in to comment.