diff --git a/acrobat/blocks/verb-widget/verb-widget.css b/acrobat/blocks/verb-widget/verb-widget.css index 6857cfcd..3d85842b 100644 --- a/acrobat/blocks/verb-widget/verb-widget.css +++ b/acrobat/blocks/verb-widget/verb-widget.css @@ -6,6 +6,10 @@ padding: 19px; } +.verb-widget.signed-in { + min-height: 560px; +} + .verb-widget.ready { color: initial; } @@ -72,6 +76,10 @@ justify-content: center; } +.verb-widget.signed-in .verb-footer { + display: none; +} + .verb-footer a { text-decoration: underline; } diff --git a/acrobat/blocks/verb-widget/verb-widget.js b/acrobat/blocks/verb-widget/verb-widget.js index 8d76ebcf..b7aa6e39 100644 --- a/acrobat/blocks/verb-widget/verb-widget.js +++ b/acrobat/blocks/verb-widget/verb-widget.js @@ -183,19 +183,21 @@ export default async function init(element) { element.append(widget, footer); } - // Redirect after IMS:Ready - window.addEventListener('IMS:Ready', () => { - if (window.adobeIMS.isSignedInUser() - && window.adobeIMS.getAccountType() !== 'type1') { - redDir(VERB); + function checkSignedInUser() { + if (window.adobeIMS?.isSignedInUser?.()) { + element.classList.add('signed-in'); + if (window.adobeIMS.getAccountType() !== 'type1') { + redDir(VERB); + } } - }); - // Race Condition - if (window.adobeIMS?.isSignedInUser() - && window.adobeIMS?.getAccountType() !== 'type1') { - redDir(VERB); } + // Race the condition + checkSignedInUser(); + + // Redirect after IMS:Ready + window.addEventListener('IMS:Ready', checkSignedInUser); + // Analytics verbAnalytics('landing:shown', VERB); @@ -252,6 +254,11 @@ export default async function init(element) { setUser(); } + if (e.detail?.event === 'cancel') { + verbAnalytics('job:cancel', VERB, e.detail?.data); + setUser(); + } + if (e.detail?.event === 'uploading') { verbAnalytics('job:uploading', VERB, e.detail?.data); setUser();