Skip to content

Commit

Permalink
fix: set user id manually
Browse files Browse the repository at this point in the history
  • Loading branch information
buremba committed Jul 7, 2016
1 parent 336846f commit e921efb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions rakam.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ Rakam.prototype.init = function (apiKey, opt_userId, opt_config, callback) {
_saveCookieData(this);

log('initialized with apiKey=' + apiKey);
this.setUserId(opt_userId);

if (this.options.saveEvents) {
var savedUnsentEventsString = localStorage.getItem(this.options.unsentKey);
Expand Down Expand Up @@ -293,11 +292,12 @@ Rakam.prototype.init = function (apiKey, opt_userId, opt_config, callback) {
}
this._lastEventTime = now;
localStorage.setItem(LocalStorageKeys.LAST_EVENT_TIME, this._lastEventTime);

} catch (e) {
log(e);
}

this.setUserId(opt_userId);

if (callback && typeof(callback) === 'function') {
setTimeout(function () {
callback();
Expand Down
2 changes: 1 addition & 1 deletion rakam.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/rakam.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ Rakam.prototype.init = function (apiKey, opt_userId, opt_config, callback) {
_saveCookieData(this);

log('initialized with apiKey=' + apiKey);
this.setUserId(opt_userId);

if (this.options.saveEvents) {
var savedUnsentEventsString = localStorage.getItem(this.options.unsentKey);
Expand Down Expand Up @@ -188,11 +187,12 @@ Rakam.prototype.init = function (apiKey, opt_userId, opt_config, callback) {
}
this._lastEventTime = now;
localStorage.setItem(LocalStorageKeys.LAST_EVENT_TIME, this._lastEventTime);

} catch (e) {
log(e);
}

this.setUserId(opt_userId);

if (callback && typeof(callback) === 'function') {
setTimeout(function () {
callback();
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = '2.5.1';
module.exports = 'undefined';

0 comments on commit e921efb

Please sign in to comment.