Skip to content

Commit

Permalink
fix: Amp 85112 set user id is not queued in snippet v1 (#592)
Browse files Browse the repository at this point in the history
* fix: proxy non-promised methods in browser-snippet (#591)

* fix: proxy non-promised methods in browser-snippet

* fix: removed extra semicolon in browser-snippet template

* fix: revert manual generated file changes

* chore: undo manual changes to generated snippet

* fix: update README.md for lerna to pickup package changes
  • Loading branch information
justin-fiedler authored Sep 27, 2023
1 parent 5374314 commit c5907ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/analytics-browser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Official Amplitude SDK for Web

# Doc

See our [Typescript Analytics Browser SDK](https://amplitude.github.io/Amplitude-TypeScript/modules/_amplitude_analytics_browser.html) Reference for a list and description of all available SDK methods.
See our [Analytics SDK for Browser](https://amplitude.github.io/Amplitude-TypeScript/modules/_amplitude_analytics_browser.html) Reference for a list and description of all available SDK methods.

# Installation and Quick Start

Expand Down
7 changes: 7 additions & 0 deletions scripts/templates/browser-snippet.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,19 @@ const snippet = (name, integrity, version, globalVar) => `
});
};
}
function proxyInstance(instance, fn, args) {
instance._q.push({
name: fn,
args: Array.prototype.slice.call(args, 0),
});
}
function proxyMain(instance, fn, isPromise) {
var args = arguments;
instance[fn] = function () {
if (isPromise) return {
promise: new Promise(getPromiseResult(instance, fn, Array.prototype.slice.call(arguments))),
};
proxyInstance(instance, fn, Array.prototype.slice.call(arguments));
};
}
function setUpProxy(instance) {
Expand Down

0 comments on commit c5907ef

Please sign in to comment.