Skip to content

Commit 4a7701b

Browse files
Fix error when continue button isn't present
1 parent 6c857c6 commit 4a7701b

File tree

1 file changed

+5
-3
lines changed
  • src/Umbraco.Commerce.Checkout/Client/src/surface

1 file changed

+5
-3
lines changed

src/Umbraco.Commerce.Checkout/Client/src/surface/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ function init() {
5858
// Enable / disable continue button when accepting terms
5959
const acceptTermsEl = document.getElementById('accept-terms') as HTMLInputElement;
6060
const continueBtn = document.getElementById('continue') as HTMLButtonElement;
61-
if (acceptTermsEl) {
61+
if (continueBtn) {
62+
if (acceptTermsEl) {
6263
acceptTermsEl.addEventListener('change', () => {
63-
continueBtn.disabled = !acceptTermsEl.checked;
64+
continueBtn.disabled = !acceptTermsEl.checked;
6465
});
65-
} else {
66+
} else {
6667
continueBtn.disabled = false;
68+
}
6769
}
6870
}
6971

0 commit comments

Comments
 (0)