mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2024-11-25 19:05:51 +03:00
fix: chart flickering (#644) @Hans1208
This commit is contained in:
parent
dd02cdb564
commit
5e3d6b7788
1 changed files with 9 additions and 2 deletions
|
@ -17,12 +17,19 @@ export default class Status {
|
|||
upspeedRaw: number = 0
|
||||
|
||||
constructor(in_state?: Optional<ServerState>) {
|
||||
const previous = store.state.status
|
||||
|
||||
if (!in_state) {
|
||||
this.alltimeDownloaded = previous.alltimeDownloaded
|
||||
this.alltimeUploaded = previous.alltimeUploaded
|
||||
this.freeDiskSpace = previous.freeDiskSpace
|
||||
this.sessionDownloaded = previous.sessionDownloaded
|
||||
this.sessionUploaded = previous.sessionUploaded
|
||||
|
||||
Object.freeze(this)
|
||||
return
|
||||
}
|
||||
|
||||
const previous = store.state.status
|
||||
|
||||
this.alltimeDownloaded = in_state.alltime_dl || previous.alltimeDownloaded
|
||||
this.alltimeUploaded = in_state.alltime_ul || previous.alltimeUploaded
|
||||
this.altSpeed = in_state.use_alt_speed_limits !== undefined ? in_state.use_alt_speed_limits : previous.altSpeed
|
||||
|
|
Loading…
Reference in a new issue