mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-02 13:51:48 +00:00
Ensured new visits are prepended and not appended, ensuring they keep the proper order
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ export default buildReducer<ShortUrlVisits, ShortUrlVisitsCombinedAction>({
|
||||
.filter(({ shortUrl }) => shortUrl && shortUrlMatches(shortUrl, shortCode, domain))
|
||||
.map(({ visit }) => visit);
|
||||
|
||||
return { ...state, visits: [ ...visits, ...newVisits ] };
|
||||
return { ...state, visits: [ ...newVisits, ...visits ] };
|
||||
},
|
||||
}, initialState);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export default buildReducer<TagVisits, TagsVisitsCombinedAction>({
|
||||
.filter(({ shortUrl }) => shortUrl?.tags.includes(tag))
|
||||
.map(({ visit }) => visit);
|
||||
|
||||
return { ...state, visits: [ ...visits, ...newVisits ] };
|
||||
return { ...state, visits: [ ...newVisits, ...visits ] };
|
||||
},
|
||||
}, initialState);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user