Skip to content

Commit

Permalink
fix: nested object in options are shared across multiple instances
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpagtakhan committed Oct 25, 2022
1 parent b4187d2 commit ea81a7f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/amplitude-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ var AmplitudeClient = function AmplitudeClient(instanceName) {
this._instanceName = utils.isEmptyString(instanceName) ? Constants.DEFAULT_INSTANCE : instanceName.toLowerCase();
this._unsentEvents = [];
this._unsentIdentifys = [];
this.options = { ...DEFAULT_OPTIONS, trackingOptions: { ...DEFAULT_OPTIONS.trackingOptions } };
this.options = {
...DEFAULT_OPTIONS,
headers: { ...DEFAULT_OPTIONS.headers },
library: { ...DEFAULT_OPTIONS.library },
plan: { ...DEFAULT_OPTIONS.plan },
trackingOptions: { ...DEFAULT_OPTIONS.trackingOptions },
};
this.cookieStorage = new cookieStorage().getStorage();
this._q = []; // queue for proxied functions before script load
this._sending = false;
Expand Down

0 comments on commit ea81a7f

Please sign in to comment.