...
|
...
|
@@ -106,10 +106,28 @@ export function header() { |
|
|
};
|
|
|
}
|
|
|
|
|
|
export function headerOnlyDispatchSuccess() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {section} = getState();
|
|
|
if (section.isFetching) {
|
|
|
return;
|
|
|
}
|
|
|
// dispatch(headerRequest());
|
|
|
return new SectionService().header(section.id)
|
|
|
.then(json => {
|
|
|
let payload = parseHeader(json);
|
|
|
dispatch(headerSuccess(payload));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
// dispatch(headerFailure());
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function newPost(ptr = false) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {section, user} = getState();
|
|
|
if (section.new.isFetching || (!ptr && section.new.endReached)) {
|
|
|
if (section.new.isFetching || (!ptr && section.new.endReached) || section.new.error !== null) {
|
|
|
return;
|
|
|
}
|
|
|
dispatch(newPostRequest(ptr));
|
...
|
...
|
@@ -139,7 +157,7 @@ export function newPost(ptr = false) { |
|
|
export function hotPost(ptr = false) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {section, user} = getState();
|
|
|
if (section.hot.isFetching || (!ptr && section.hot.endReached)) {
|
|
|
if (section.hot.isFetching || (!ptr && section.hot.endReached) || section.hot.error !== null) {
|
|
|
return;
|
|
|
}
|
|
|
dispatch(hotPostRequest(ptr));
|
...
|
...
|
|