Hide terms and conditions checkbox before Fastlane authentication

This commit is contained in:
Emili Castells Guasch 2024-05-06 15:31:30 +02:00
parent 9ff89f16f0
commit 5a037b1c93

View file

@ -162,6 +162,20 @@ class AxoManager {
ev.preventDefault();
}
});
// Listening to status update event
document.addEventListener('axo_status_updated', (ev) => {
const termsField = document.querySelector("[name='terms-field']");
if(termsField) {
const status = ev.detail;
if(status.active && status.validEmail === false && status.hasProfile === false) {
termsField.parentElement.style.display = 'none';
} else {
termsField.parentElement.style.display = 'block';
}
}
});
}
rerender() {
@ -347,6 +361,8 @@ class AxoManager {
log('Status updated', JSON.parse(JSON.stringify(this.status)));
document.dispatchEvent(new CustomEvent("axo_status_updated", {detail: this.status}));
this.rerender();
}