inline useless functions
This commit is contained in:
parent
29a4c0ca69
commit
cb54bbe6b6
1 changed files with 14 additions and 23 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue