@ludens-reklame/profiler-client
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -29,2 +29,4 @@ interface Opts { | ||
private contactRef; | ||
private personalize; | ||
private hasPersonalized; | ||
constructor(opts: Opts); | ||
@@ -31,0 +33,0 @@ push(opts: PushOpts): Promise<void>; |
@@ -42,7 +42,9 @@ "use strict"; | ||
function Profiler(opts) { | ||
this.hasPersonalized = false; | ||
this.organization = opts.organization; | ||
this.personalize = opts.personalize || false; | ||
if (window && 'localStorage' in window) { | ||
this.contactRef = window.localStorage.getItem('profilerRef'); | ||
} | ||
if (opts.personalize) { | ||
if (this.personalize && this.contactRef) { | ||
this.handlePersonalizations(); | ||
@@ -162,2 +164,3 @@ } | ||
} | ||
this.hasPersonalized = true; | ||
_a.label = 2; | ||
@@ -201,2 +204,5 @@ case 2: return [3 /*break*/, 4]; | ||
this.contactRef = json.ref; | ||
if (this.personalize && !this.hasPersonalized && this.contactRef) { | ||
this.handlePersonalizations(); | ||
} | ||
} | ||
@@ -203,0 +209,0 @@ return [3 /*break*/, 4]; |
{ | ||
"name": "@ludens-reklame/profiler-client", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Profiler for all", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
16112
262