Skip to content
Snippets Groups Projects
Commit 0a0286cf authored by Sandro Lutz's avatar Sandro Lutz Committed by scmoritz
Browse files

Hide signup button before event signup has loaded

parent 3e099f57
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,10 @@ export function getCurrentSignup() {
return this.currentSignup;
}
export function currentSignupHasLoaded() {
return this.currentSignupLoaded;
}
export function checkCurrentSignup() {
const queryString = m.buildQueryString({
where: JSON.stringify({
......@@ -40,6 +44,7 @@ export function checkCurrentSignup() {
} : {},
}).then((result) => {
[this.currentSignup] = result._items;
this.currentSignupLoaded = true;
log(this.currentSignup);
});
}
......
......@@ -17,7 +17,7 @@ class EventSignupForm {
return m('div');
}
if (isLoggedIn()) {
if (typeof events.getCurrentSignup() === 'undefined') {
if (events.currentSignupHasLoaded() && typeof events.getCurrentSignup() === 'undefined') {
return m('button', { onclick() { events.signupCurrent(); } }, 'signup');
}
} else if (events.getCurrent().allow_email_signup) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment