mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2024-11-29 05:28:53 +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
|
upspeedRaw: number = 0
|
||||||
|
|
||||||
constructor(in_state?: Optional<ServerState>) {
|
constructor(in_state?: Optional<ServerState>) {
|
||||||
|
const previous = store.state.status
|
||||||
|
|
||||||
if (!in_state) {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const previous = store.state.status
|
|
||||||
|
|
||||||
this.alltimeDownloaded = in_state.alltime_dl || previous.alltimeDownloaded
|
this.alltimeDownloaded = in_state.alltime_dl || previous.alltimeDownloaded
|
||||||
this.alltimeUploaded = in_state.alltime_ul || previous.alltimeUploaded
|
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
|
this.altSpeed = in_state.use_alt_speed_limits !== undefined ? in_state.use_alt_speed_limits : previous.altSpeed
|
||||||
|
|
Loading…
Reference in a new issue