Skip to content

Commit 9af423c

Browse files
author
rodik
committed
Load on server should dispatch end global load only if there was some async connect items
1 parent c37b771 commit 9af423c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/ReduxAsyncConnect.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ function loadAsyncConnect({components, filter = () => true, ...rest}) {
6161
}
6262

6363
export function loadOnServer(args) {
64-
return loadAsyncConnect(args).promise.then(() => {
65-
args.store.dispatch(endGlobalLoad());
66-
});
64+
const result = loadAsyncConnect(args);
65+
if (result.async) {
66+
result.promise.then(() => {
67+
args.store.dispatch(endGlobalLoad());
68+
});
69+
}
70+
return result.promise;
6771
}
6872

6973
let loadDataCounter = 0;

0 commit comments

Comments
 (0)