From 3e21cccb14192baeb8df45017149e7c89ea33d14 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 14 Nov 2020 13:01:35 +0100 Subject: [PATCH 1/2] Fixed visits getting accumulated every time the visits page is opened --- src/visits/services/VisitsParser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/visits/services/VisitsParser.ts b/src/visits/services/VisitsParser.ts index 5a83c035..2febfd16 100644 --- a/src/visits/services/VisitsParser.ts +++ b/src/visits/services/VisitsParser.ts @@ -1,4 +1,4 @@ -import { isNil, map, reduce } from 'ramda'; +import { isNil, map } from 'ramda'; import { extractDomain, parseUserAgent } from '../../utils/helpers/visits'; import { hasValue } from '../../utils/utils'; import { CityStats, NormalizedVisit, Stats, Visit, VisitsStats } from '../types'; @@ -53,7 +53,7 @@ const updateCitiesForMapForVisit = (citiesForMapStats: Record citiesForMapStats[city] = currentCity; }; -export const processStatsFromVisits = reduce( +export const processStatsFromVisits = (visits: NormalizedVisit[]) => visits.reduce( (stats: VisitsStats, visit: NormalizedVisit) => { // We mutate the original object because it has a big performance impact when large data sets are processed updateOsStatsForVisit(stats.os, visit); From c890124e676d5e06c7edf47fe6c87ad3510f837f Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 14 Nov 2020 13:02:28 +0100 Subject: [PATCH 2/2] Updated changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e837d36..7021d265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## [2.6.2] - 2020-11-14 ### Added * *Nothing* @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed * [#334](https://github.com/shlinkio/shlink-web-client/issues/334) Fixed color-picker making the app crash when closing the modal without closing the color-picker, and then trying to open the modal again. +* [#333](https://github.com/shlinkio/shlink-web-client/issues/333) Fixed visits getting accumulated every time the visits page is opened. ## [2.6.1] - 2020-10-31