Skip to content

Commit

Permalink
Merge branch 'stage' into MWPW-161240
Browse files Browse the repository at this point in the history
  • Loading branch information
TsayAdobe authored Nov 22, 2024
2 parents d8ec798 + 4823bcd commit 295bd60
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
8 changes: 8 additions & 0 deletions acrobat/blocks/verb-widget/verb-widget.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
padding: 19px;
}

.verb-widget.signed-in {
min-height: 560px;
}

.verb-widget.ready {
color: initial;
}
Expand Down Expand Up @@ -72,6 +76,10 @@
justify-content: center;
}

.verb-widget.signed-in .verb-footer {
display: none;
}

.verb-footer a {
text-decoration: underline;
}
Expand Down
27 changes: 17 additions & 10 deletions acrobat/blocks/verb-widget/verb-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 295bd60

Please sign in to comment.