Ensured new visits are prepended and not appended, ensuring they keep the proper order

This commit is contained in:
Alejandro Celaya
2021-05-01 16:39:13 +02:00
parent e44527e9c9
commit 66deba29f5
7 changed files with 15 additions and 15 deletions

View File

@@ -44,7 +44,7 @@ export default buildReducer<VisitsInfo, OrphanVisitsCombinedAction>({
const { visits } = state;
const newVisits = createdVisits.map(({ visit }) => visit);
return { ...state, visits: [ ...visits, ...newVisits ] };
return { ...state, visits: [ ...newVisits, ...visits ] };
},
}, initialState);