We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2773b4e commit 71c689cCopy full SHA for 71c689c
src/widgets/Base.js
@@ -248,7 +248,18 @@ class Base {
248
cmp.waitForCmp(async () => {
249
try {
250
const consent = await cmp.getConsent(this.cfg.ucId);
251
- const hasConsent = consent === true || (consent && typeof consent.then === 'function' && await consent);
+ let hasConsent = false;
252
+ if (consent === true) {
253
+ hasConsent = true;
254
+ } else if (consent && typeof consent.then === 'function') {
255
+ try {
256
+ hasConsent = await consent;
257
+ } catch (e) {
258
+ hasConsent = false;
259
+ }
260
+ } else if (consent) {
261
+ hasConsent = Boolean(consent);
262
263
264
if (hasConsent && this.container && !this.isActivated) {
265
// Trigger click on accept button to activate properly
0 commit comments