Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we remove Promise.sleep on next form step? #414

Open
bitbeckers opened this issue Feb 6, 2025 · 0 comments
Open

Can we remove Promise.sleep on next form step? #414

bitbeckers opened this issue Feb 6, 2025 · 0 comments
Labels
question Further information is requested

Comments

@bitbeckers
Copy link
Contributor

What is it?

When moving from form step 'who did what & when' to 'mint', the form is slow. Apparently we introduced a sleep promise:

 const handleNextClick = async () => {
    if (currentStep === 2) {
      await new Promise((resolve) => setTimeout(resolve, 1500));
      await takeCardSnapshot();
    }
    const currentStepFields = hypercertFormSteps.get(currentStep)?.fields ?? [];
    await form.trigger(currentStepFields);
    if (!isCurrentStepValid()) {
      return;
    }
    setCurrentStep(currentStep + 1);
  };

Can this be removed? Can we optimise by validation and then taking the snapshot?

@bitbeckers bitbeckers added the question Further information is requested label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: In progress
Development

No branches or pull requests

1 participant