PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.3.75
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.3.75
11.3.75 11.3.73 11.3.71 11.3.70 11.3.69 11.3.64 11.3.65 11.3.62 11.3.61 11.3.56 11.3.58 11.0.31 11.0.52 11.0.54 11.0.56 11.0.58 11.0.7 11.1.10 11.1.11 11.1.13 11.1.14 11.1.15 11.1.2 11.1.20 11.1.21 All 73 releases
← All changes | scripts/utils/backgroundAppUtils.ts +3 -2 11.3.7311.3.75 View file →
@@ -6,8 +6,9 @@
6 6 leadinPluginVersion,
7 7 } from '../constants/leadinConfig';
8 8 import { initApp } from './appUtils';
9 9 import { fetchAccessToken } from '../api/wordpressApiClient';
10 +import { isEmbedderReady } from './embedderReady';
10 11
11 12 type CallbackFn = (...args: any[]) => void;
12 13
13 14 export function initBackgroundApp(initFn: CallbackFn | CallbackFn[]) {
@@ -30,12 +31,12 @@
30 31 export const getOrCreateBackgroundApp = (accessToken = '', expiresIn = 0) => {
31 32 if ((window as any).LeadinBackgroundApp) {
32 33 return (window as any).LeadinBackgroundApp;
33 34 }
34 - const { IntegratedAppEmbedder, IntegratedAppOptions }: any = window;
35 - if (!IntegratedAppEmbedder || typeof IntegratedAppOptions !== 'function') {
35 + if (!isEmbedderReady()) {
36 36 return null;
37 37 }
38 + const { IntegratedAppEmbedder, IntegratedAppOptions }: any = window;
38 39 const options = new IntegratedAppOptions()
39 40 .setLocale(locale)
40 41 .setDeviceId(deviceId)
41 42 .setLeadinConfig(getLeadinConfig())