From b4a6f911cd5d1577a8f708571f2f07b8b8cbc283 Mon Sep 17 00:00:00 2001 From: Yen-chi Chen Date: Tue, 12 Sep 2023 01:23:50 +0000 Subject: [PATCH] refactor: minor fix --- 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))); + } } };