feature/improved-article-content-loading #179

Merged
danysmall merged 7 commits from feature/improved-article-content-loading into develop 2022-11-12 23:19:40 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit be4587f7cc - Show all commits

View File

@ -20,8 +20,8 @@ const useArticleCommonStore = (): ArticleStore => {
setError(true);
return null;
}
setLoading(false);
setCurrentArticle(fromStore);
setLoading(false);
return fromStore;
}
setLoading(false);

View File

@ -17,13 +17,13 @@ const articleReducer = (
): ArticleStoreState => {
switch (action.type) {
case actionTypes.SET_ARTICLE:
return { ...state, articles: action.updatedList, currentArticle: action.article, hasError: typeof action.article === undefined };
return { ...state, articles: action.updatedList, currentArticle: action.article, hasError: typeof action.article === undefined, isLoading: false };
case actionTypes.GET_ARTICLE:
return { ...state, isLoading: true };
case actionTypes.GET_ARTICLE_SUCCESS:
return { ...state, isLoading: false, currentArticle: action.payload };
case actionTypes.GET_ARTICLE_FAILURE:
return { ...state, hasError: true, isLoading: false };
return { ...state, hasError: false, isLoading: true };
default:
return state;
}