From 4466d733b45e18697c8f81a8c23b5a51cecbaaca Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 13 Sep 2022 15:56:53 +0200 Subject: [PATCH] Fixed visits not being displayed after a large loading has finished --- src/visits/reducers/domainVisits.ts | 2 +- src/visits/reducers/nonOrphanVisits.ts | 4 +++- src/visits/reducers/orphanVisits.ts | 4 +++- src/visits/reducers/shortUrlVisits.ts | 1 + src/visits/reducers/tagVisits.ts | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/visits/reducers/domainVisits.ts b/src/visits/reducers/domainVisits.ts index 3570e023..17ee4f63 100644 --- a/src/visits/reducers/domainVisits.ts +++ b/src/visits/reducers/domainVisits.ts @@ -50,7 +50,7 @@ export default buildReducer({ [GET_DOMAIN_VISITS_START]: () => ({ ...initialState, loading: true }), [GET_DOMAIN_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }), [GET_DOMAIN_VISITS]: (state, { visits, domain, query }) => ( - { ...state, visits, domain, query, loading: false, error: false } + { ...state, visits, domain, query, loading: false, loadingLarge: false, error: false } ), [GET_DOMAIN_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), [GET_DOMAIN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), diff --git a/src/visits/reducers/nonOrphanVisits.ts b/src/visits/reducers/nonOrphanVisits.ts index 41d1a5dc..05133800 100644 --- a/src/visits/reducers/nonOrphanVisits.ts +++ b/src/visits/reducers/nonOrphanVisits.ts @@ -45,7 +45,9 @@ const initialState: VisitsInfo = { export default buildReducer({ [GET_NON_ORPHAN_VISITS_START]: () => ({ ...initialState, loading: true }), [GET_NON_ORPHAN_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }), - [GET_NON_ORPHAN_VISITS]: (state, { visits, query }) => ({ ...state, visits, query, loading: false, error: false }), + [GET_NON_ORPHAN_VISITS]: (state, { visits, query }) => ( + { ...state, visits, query, loading: false, loadingLarge: false, error: false } + ), [GET_NON_ORPHAN_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), [GET_NON_ORPHAN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_NON_ORPHAN_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), diff --git a/src/visits/reducers/orphanVisits.ts b/src/visits/reducers/orphanVisits.ts index 69fec2cd..8b6aee65 100644 --- a/src/visits/reducers/orphanVisits.ts +++ b/src/visits/reducers/orphanVisits.ts @@ -48,7 +48,9 @@ const initialState: VisitsInfo = { export default buildReducer({ [GET_ORPHAN_VISITS_START]: () => ({ ...initialState, loading: true }), [GET_ORPHAN_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }), - [GET_ORPHAN_VISITS]: (state, { visits, query }) => ({ ...state, visits, query, loading: false, error: false }), + [GET_ORPHAN_VISITS]: (state, { visits, query }) => ( + { ...state, visits, query, loading: false, loadingLarge: false, error: false } + ), [GET_ORPHAN_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), [GET_ORPHAN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_ORPHAN_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), diff --git a/src/visits/reducers/shortUrlVisits.ts b/src/visits/reducers/shortUrlVisits.ts index 9f568768..00327c46 100644 --- a/src/visits/reducers/shortUrlVisits.ts +++ b/src/visits/reducers/shortUrlVisits.ts @@ -53,6 +53,7 @@ export default buildReducer({ domain, query, loading: false, + loadingLarge: false, error: false, }), [GET_SHORT_URL_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), diff --git a/src/visits/reducers/tagVisits.ts b/src/visits/reducers/tagVisits.ts index b57f6836..f2fe6b85 100644 --- a/src/visits/reducers/tagVisits.ts +++ b/src/visits/reducers/tagVisits.ts @@ -46,7 +46,9 @@ const initialState: TagVisits = { export default buildReducer({ [GET_TAG_VISITS_START]: () => ({ ...initialState, loading: true }), [GET_TAG_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }), - [GET_TAG_VISITS]: (state, { visits, tag, query }) => ({ ...state, visits, tag, query, loading: false, error: false }), + [GET_TAG_VISITS]: (state, { visits, tag, query }) => ( + { ...state, visits, tag, query, loading: false, loadingLarge: false, error: false } + ), [GET_TAG_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), [GET_TAG_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_TAG_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }),