Skip to content

Commit

Permalink
fix: avoid multiple noConflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dackmin committed Sep 5, 2022
1 parent c829f1e commit b434aae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/AccessContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const AccessContext = ({
await loadScript(scriptUrl, 'poool-react-access-lib');
}

const lib = globalThis.Access.noConflict();
const accessRef = globalThis.PooolAccess || globalThis.Access;
const lib = accessRef.noConflict();
dispatch({ lib });
};

Expand Down
2 changes: 1 addition & 1 deletion src/AuditContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const AuditContext = ({
await loadScript(scriptUrl, 'poool-react-audit-lib');
}

const auditRef = globalThis.Audit || globalThis.PooolAudit;
const auditRef = globalThis.PooolAudit || globalThis.Audit;
const lib = auditRef.noConflict().init(appId).config(config);

Object.entries(events || {}).forEach(([event, callback]) => {
Expand Down

0 comments on commit b434aae

Please sign in to comment.