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

Add Progress Spinner when hitting the Next button on the Match Columns Step #248

Open
danielletully opened this issue Jan 30, 2024 · 3 comments

Comments

@danielletully
Copy link

Just wondering if there is an easy way to add a Progress Spinner when hitting the Next button on the Match Columns Step? My files are taking about 30 seconds to process. Thanks.

@benzler
Copy link

benzler commented Feb 5, 2024

@danielletully I have the same issue. Are you running a custom data hook?

@benzler
Copy link

benzler commented Feb 6, 2024

@danielletully I have the same issue. Are you running a custom data hook?

I noticed that the loading indicator of the "next" button wasn't triggered when the function wasn't called asynchronously.

Here's how I managed to resolve it:

selectHeaderStepHook={async (
    headerValues: RawData,
    Data: RawData[],
  ) => {
    const d = await new Promise<{
      headerValues: RawData;
      Data: RawData[];
    }>((resolve) => {
      setTimeout(() => {
        const result = doCustomDataMapping(
          headerValues,
          data,
          params,
          fields,
        );
        resolve(result);
      }, 0);
    });
    return d;
  }}

By making the selectHeaderStepHook function asynchronous (async), and awaiting the promise creation using await, it ensures that the loading indicator functions as expected even with the slight delay introduced by setTimeout.

@danielletully
Copy link
Author

@benzler Thank you so much!!! This worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants