Skip to content

Commit

Permalink
fix MWPW-136656
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruchika4 authored Sep 19, 2023
1 parent e83d578 commit 50b320d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/blocks/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export function sendAnalytics(event) {
function closeModal(modal) {
const { id } = modal;
const closeEvent = new Event('milo:modal:closed');
document.body.classList.remove('modal-open');
if(document.body.classList.contains('modal-open') {
document.body.classList.remove('modal-open');
}
window.dispatchEvent(closeEvent);
const localeModal = id?.includes('locale-modal') ? 'localeModal' : 'milo';
const analyticsEventName = window.location.hash ? window.location.hash.replace('#', '') : localeModal;
Expand Down

0 comments on commit 50b320d

Please sign in to comment.