@cardsjd/portal 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/NextGenAdMobPortal.js +18 -8
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ export class NextGenAdMobPortal extends BasePortal {
|
|
|
20
20
|
this.adProviderName = 'CapgoAdmob';
|
|
21
21
|
this.isSetup = false;
|
|
22
22
|
this.isSetupLoading = false;
|
|
23
|
+
this._setupPromise = null;
|
|
23
24
|
this.isInterstitialAdReady = false;
|
|
24
25
|
this._isRewardedAdLoaded = false;
|
|
25
26
|
this._receivedReward = false;
|
|
@@ -116,18 +117,27 @@ export class NextGenAdMobPortal extends BasePortal {
|
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
|
-
if (this.
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
if (!this._setupPromise) {
|
|
121
|
+
this._setupPromise = (async () => {
|
|
122
|
+
this.isSetupLoading = true;
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
try {
|
|
125
|
+
await this.updateConsentInfo();
|
|
126
|
+
} catch (error) {
|
|
127
|
+
console.error('Failed to update UMP consent info:', error);
|
|
128
|
+
} finally {
|
|
129
|
+
this.isSetupLoading = false;
|
|
130
|
+
}
|
|
131
|
+
})();
|
|
132
|
+
}
|
|
124
133
|
|
|
134
|
+
const setupPromise = this._setupPromise;
|
|
125
135
|
try {
|
|
126
|
-
await
|
|
127
|
-
} catch (error) {
|
|
128
|
-
console.error('Failed to update UMP consent info:', error);
|
|
136
|
+
await setupPromise;
|
|
129
137
|
} finally {
|
|
130
|
-
this.
|
|
138
|
+
if (this._setupPromise === setupPromise) {
|
|
139
|
+
this._setupPromise = null;
|
|
140
|
+
}
|
|
131
141
|
}
|
|
132
142
|
}
|
|
133
143
|
|