add op.js to public site
This commit is contained in:
@@ -81,6 +81,8 @@ export class MixanWeb extends Mixan<MixanWebOptions> {
|
||||
} else {
|
||||
window.addEventListener('locationchange', () => this.screenView());
|
||||
}
|
||||
|
||||
this.screenView();
|
||||
}
|
||||
|
||||
public screenView(properties?: Record<string, unknown>): void {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"module": "index.ts",
|
||||
"scripts": {
|
||||
"build": "rm -rf dist && tsup",
|
||||
"build-for-openpanel": "pnpm build && cp dist/cdn.global.js ../../apps/public/public/op.js",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
|
||||
"typecheck": "tsc --noEmit"
|
||||
|
||||
@@ -41,11 +41,11 @@ function createApi(_url: string, clientId: string, clientSecret?: string) {
|
||||
...(options ?? {}),
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.status !== 200) {
|
||||
if (res.status !== 200 && res.status !== 202) {
|
||||
return retry(attempt, resolve);
|
||||
}
|
||||
|
||||
const response = await res.json();
|
||||
const response = await res.text();
|
||||
|
||||
if (!response) {
|
||||
return resolve(null);
|
||||
|
||||
Reference in New Issue
Block a user