add fetchifneeded to changesets view and use state

This commit is contained in:
Maren Süwer
2018-09-20 15:43:12 +02:00
parent a1838c1ec8
commit e38275259f
2 changed files with 28 additions and 4 deletions

View File

@@ -37,8 +37,9 @@ export function fetchChangesetIfNeeded(
repoName: string,
id: string
) {
return function(dispatch: any) {
if (shouldFetchChangeset(state, namespace, repoName, id)) {
return function(dispatch: any, getState) {
console.log(getState());
if (shouldFetchChangeset(getState(), namespace, repoName, id)) {
return dispatch(fetchChangeset(namespace, repoName, id));
}
};