Skip to content

Commit 11b2701

Browse files
authored
Merge pull request #17 from syadykin/master
Correcting `isLoading` prop processing
2 parents 24b6a94 + f62abc5 commit 11b2701

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/LoadingMiddleware.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ const LoadingMiddleware = ({ children, isLoading = false }) => {
2323

2424
useEffect(() => {
2525
if (!isFirstRender.current) {
26-
// didn't use start() to skip unnecessary topbar triggering
27-
if (isLoading)
28-
setLoading(true);
29-
else
26+
if (isLoading && !loading)
27+
start();
28+
else if (loading)
3029
done();
3130
} else {
3231
isFirstRender.current = false;

0 commit comments

Comments
 (0)