Skip to content

Commit

Permalink
Fix pick up availability 'Unavailable' (Shopify#855)
Browse files Browse the repository at this point in the history
* Fix pick up availability 'Unavailable'

* reuse similar check used in the same file
  • Loading branch information
ludoboludo authored Nov 12, 2021
1 parent ac39c2c commit 5b27d4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/pickup-availability.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ if (!customElements.get('pickup-availability')) {

document.body.appendChild(sectionInnerHTML.querySelector('pickup-availability-drawer'));

this.querySelector('button').addEventListener('click', (evt) => {
const button = this.querySelector('button');
if (button) button.addEventListener('click', (evt) => {
document.querySelector('pickup-availability-drawer').show(evt.target);
});
}
Expand Down

0 comments on commit 5b27d4b

Please sign in to comment.