From 16ef498aa33ca8ef69896887b6cebb5d5ba6a5b6 Mon Sep 17 00:00:00 2001 From: Yen-chi Chen Date: Tue, 12 Sep 2023 09:33:40 +0800 Subject: [PATCH] refactor: minor fix (#1163) --- src/actions/experience.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/actions/experience.js b/src/actions/experience.js index a395e248a..707a583fa 100644 --- a/src/actions/experience.js +++ b/src/actions/experience.js @@ -120,6 +120,13 @@ export const loadMoreRelatedExperiences = () => async ( ); } } catch (error) { - dispatch(setRelatedExperiencesState(getError(error))); + const previousState = relatedExperiencesStateSelector(getState()); // FetchBox + + if ( + experienceId === previousState.data.experienceId && + page === previousState.data.page + ) { + dispatch(setRelatedExperiencesState(getError(error))); + } } };