Skip to content

Commit

Permalink
feat: Fix error on cart page.
Browse files Browse the repository at this point in the history
Refs: #255
  • Loading branch information
eugene-shab committed Dec 27, 2023
1 parent a2af8bb commit 71cfc23
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions view/frontend/web/js/view/cart/subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ define(
}
var self = this;

function callback() {
self.initInstantPurchaseConfig();
observer.disconnect();

if ($('#instant-purchase').length ) {
function callback() {
self.initInstantPurchaseConfig();
observer.disconnect();
}
const observer = new MutationObserver(callback);
observer.observe(
document.getElementById('instant-purchase'),
{ attributes: true, childList: true, subtree: true, characterData: true}
);
}
const observer = new MutationObserver(callback);
observer.observe(
document.getElementById('instant-purchase'),
{ attributes: true, childList: true, subtree: true, characterData: true}
);
},

initObservable: function () {
Expand Down

0 comments on commit 71cfc23

Please sign in to comment.