Skip to content

Commit

Permalink
Merge pull request #5922 from marmelab/fix-data-provider-stacked-quer…
Browse files Browse the repository at this point in the history
…ies-resolution

Fix DataProvider Stacked Queries Resolution
  • Loading branch information
fzaninotto committed Feb 16, 2021
2 parents bc74249 + 617c16e commit 0d963d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ra-core/src/dataProvider/useDataProvider.ts
Expand Up @@ -217,7 +217,9 @@ const later = (delay = 100): Promise<void> =>
// get a Promise that resolves once a condition is satisfied
const waitFor = (condition: () => boolean): Promise<void> =>
new Promise(resolve =>
condition() ? resolve() : later().then(() => waitFor(condition))
condition()
? resolve()
: later().then(() => waitFor(condition).then(() => resolve()))
);

export default useDataProvider;

0 comments on commit 0d963d0

Please sign in to comment.