Skip to content

Commit

Permalink
modal show bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen committed Mar 21, 2024
1 parent d1674d3 commit 6be946f
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions portal/static/js/src/empro.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ emproObj.prototype.init = function () {
"author date ",
authoredDate,
" assessment completed ",
assessmentCompleted,
assessmentCompleted,
" identifier ",
identifier
);
Expand All @@ -412,10 +412,7 @@ emproObj.prototype.init = function () {
assessmentCompleted &&
today === authoredDate;

if (!autoShowModal) {
this.setLoadingVis(); // hide loading indicator when done
return;
}
console.log("Should show EMPRO thank you modal ", autoShowModal);

this.initTriggerDomains((result) => {
this.setLoadingVis(); // hide loading indicator when done
Expand All @@ -425,21 +422,23 @@ emproObj.prototype.init = function () {
console.log("Error retrieving trigger data: ", result.reason);
}
}

/*
* set thank you modal accessed flag here
*/
localStorage.setItem(cachedAccessKey, `true`);

// console.log("Opt out domain? ", this.optOutDomains);
if (this.optOutDomains.length > 0) {
this.populateOptoutInputItems();
this.initOptOutElementEvents();
this.initOptOutModal(true);
this.initThankyouModal(false);
return;
if (autoShowModal) {
localStorage.setItem(this.cachedAccessKey, `true`);
// console.log("Opt out domain? ", this.optOutDomains);
if (this.optOutDomains.length > 0) {
this.populateOptoutInputItems();
this.initOptOutElementEvents();
this.initOptOutModal(true);
this.initThankyouModal(false);
return;
}
}

this.initThankyouModal(true);
this.initThankyouModal(autoShowModal);
});
}
);
Expand All @@ -461,7 +460,6 @@ emproObj.prototype.processTriggerData = function (data) {
return false;
}
var self = this;
console.log("trigger data ", data);

// set visit month related to trigger data
this.visitMonth = data.visit_month;
Expand Down

0 comments on commit 6be946f

Please sign in to comment.