inline useless functions

This commit is contained in:
counterweight 2025-03-14 17:03:29 +01:00
parent 29a4c0ca69
commit cb54bbe6b6
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C

View file

@ -13,8 +13,20 @@ const invitesFunction = () => {
const signupButton = new NostrSignupButton({
parentElement: nostrSignupArea,
id: 'nostr-signup-button',
onClickCallback: () => {
acceptInvite();
onClickCallback: async () => {
const verifyResponse =
await signupService.requestAndRespondSignUpChallenge({
onNostrErrorCallback: () => {
rejectedNostrWarning.display();
},
});
if (verifyResponse.ok) {
signUpSuccessPopup.display();
setTimeout(() => {
window.location.href = constants.API_PATHS.createProfile;
}, constants.DEFAULT_REDIRECT_DELAY);
}
},
});
signupButton.render();
@ -93,27 +105,6 @@ const invitesFunction = () => {
}
);
};
function showConfirmationAndRedirect() {
signUpSuccessPopup.display();
setTimeout(() => {
window.location.href = constants.API_PATHS.createProfile;
}, constants.DEFAULT_REDIRECT_DELAY);
}
async function acceptInvite() {
const verifyResponse = await signupService.requestAndRespondSignUpChallenge(
{
onNostrErrorCallback: () => {
rejectedNostrWarning.display();
},
}
);
if (verifyResponse.ok) {
showConfirmationAndRedirect();
}
}
};
invitesFunction();