diff --git a/src/tags/reducers/tagsList.ts b/src/tags/reducers/tagsList.ts index cdd55d26..da15e123 100644 --- a/src/tags/reducers/tagsList.ts +++ b/src/tags/reducers/tagsList.ts @@ -49,10 +49,13 @@ const increaseVisitsForTags = (tags: TagIncrease[], stats: TagsStatsMap) => tags const tagStats = theStats[tag]; - tagStats.visitsCount += increase; - theStats[tag] = tagStats; // eslint-disable-line no-param-reassign - - return theStats; + return { + ...theStats, + [tag]: { + ...tagStats, + visitsCount: tagStats.visitsCount + increase, + }, + }; }, { ...stats }); const calculateVisitsPerTag = (createdVisits: CreateVisit[]): TagIncrease[] => Object.entries( createdVisits.reduce((acc, { shortUrl }) => {