diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/TrafficRecorder.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/TrafficRecorder.kt index 52e3dbf8..422fce23 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/TrafficRecorder.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/TrafficRecorder.kt @@ -130,6 +130,7 @@ object TrafficRecorder { } fun update(timeout: Boolean = false) { synchronized(this) { + unscheduleUpdateLocked() if (records.isEmpty()) return val timestamp = System.currentTimeMillis() if (!timeout && timestamp - lastUpdate <= 100) return @@ -141,7 +142,6 @@ object TrafficRecorder { SmartSnackbar.make(e).show() } lastUpdate = timestamp - updateJob = null scheduleUpdateLocked() } }