Skip to content

Commit

Permalink
NTR: fix offcanvas errors (#740)
Browse files Browse the repository at this point in the history
Co-authored-by: Vitalij Mik <[email protected]>
  • Loading branch information
BlackScorp and Vitalij Mik authored May 2, 2024
1 parent 73bbe21 commit f2985bc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ export default class MollieApplePayDirect extends Plugin {
// we need to re-init all apple pay button
// once the offcanvas is loaded (lazy) into the DOM

const pluginOffCanvas = window.PluginManager.getPluginList().OffCanvasCart.get("instances")[0];
const pluginOffCanvasInstances = window.PluginManager.getPluginList().OffCanvasCart.get("instances");
if(pluginOffCanvasInstances.length === 0){
return;
}

const pluginOffCanvas = pluginOffCanvasInstances[0];
pluginOffCanvas.$emitter.subscribe('offCanvasOpened', me.onOffCanvasOpened.bind(me));

// now update our current page
Expand Down

0 comments on commit f2985bc

Please sign in to comment.