Skip to content

Commit

Permalink
feat(core): no operation if BODL was not initialized properly
Browse files Browse the repository at this point in the history
  • Loading branch information
BC-krasnoshapka committed Jul 31, 2024
1 parent 4d4e171 commit 3c27e87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/bodl/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export class Bodl {

private call<T>(originalMethod: (payload: T) => void) {
return (payload: T) => {
if (Bodl.globalSingleton === null) {
return;
}

if (!window.bodlEvents) {
// TODO: temporary hack - wait for bodl-events script to be loaded
setTimeout(originalMethod.bind(this, payload), 500);
Expand Down

0 comments on commit 3c27e87

Please sign in to comment.