Skip to content

Commit

Permalink
Fix DataProvider Stacked Queries Resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Feb 16, 2021
1 parent bc74249 commit 617c16e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ra-core/src/dataProvider/useDataProvider.ts
Original file line number Diff line number Diff line change
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 617c16e

Please sign in to comment.