diff --git a/portal/portal.js b/portal/portal.js index 19fd334..22d460a 100644 --- a/portal/portal.js +++ b/portal/portal.js @@ -736,11 +736,17 @@ const Portal = { document.getElementById('settingState').value = biz.ADDRESSSTATE || biz.AddressState || ''; document.getElementById('settingZip').value = biz.ADDRESSZIP || biz.AddressZip || ''; + // DEBUG: show what keys the API returned + alert('BIZ KEYS: ' + Object.keys(biz).join(', ')); + alert('BRANDCOLOR=' + biz.BRANDCOLOR + ' | BrandColor=' + biz.BrandColor); + alert('HEADERIMAGEURL=' + biz.HEADERIMAGEURL + ' | HeaderImageURL=' + biz.HeaderImageURL); + // Load brand color if set const brandColor = biz.BRANDCOLOR || biz.BrandColor; if (brandColor) { this.brandColor = brandColor; const swatch = document.getElementById('brandColorSwatch'); + alert('swatch found: ' + !!swatch + ' | brandColor: ' + brandColor); if (swatch) swatch.style.backgroundColor = brandColor; } @@ -748,8 +754,13 @@ const Portal = { const headerPreview = document.getElementById('headerPreview'); const headerWrapper = document.getElementById('headerPreviewWrapper'); const headerUrl = biz.HEADERIMAGEURL || biz.HeaderImageURL; + alert('headerPreview found: ' + !!headerPreview + ' | headerUrl: ' + headerUrl); if (headerPreview && headerUrl) { + headerPreview.onerror = function() { + alert('IMG LOAD ERROR: ' + headerPreview.src); + }; headerPreview.onload = function() { + alert('IMG LOADED OK'); if (headerWrapper) headerWrapper.style.display = 'block'; }; headerPreview.src = `${headerUrl}?t=${Date.now()}`;