fix(frontend): Fix lagging issues when resizing (#2027)

This commit is contained in:
Faton Ramadani
2023-08-11 15:44:24 +02:00
committed by GitHub
parent a4ba4af478
commit c2a92b69ef
2 changed files with 9 additions and 4 deletions
+3 -1
View File
@@ -152,4 +152,6 @@
} as any
</script>
<Scatter {data} options={scatterOptions} />
<div class="relative">
<Scatter {data} options={scatterOptions} />
</div>
@@ -121,7 +121,9 @@
}
let sync = true
let mounted: boolean = false
onMount(() => {
mounted = true
loadPaths()
intervalId = setInterval(syncer, 5000)
@@ -140,10 +142,11 @@
}
})
$: if (!intervalId && autoRefresh) {
$: if (mounted && !intervalId && autoRefresh) {
intervalId = setInterval(syncer, 5000)
}
$: if (intervalId && !autoRefresh) {
$: if (mounted && intervalId && !autoRefresh) {
clearInterval(intervalId)
intervalId = undefined
}
@@ -315,7 +318,7 @@
</div>
</div>
<div class=" p-2">
<div class="p-2 w-full">
<RunChart
jobs={completedJobs}
on:zoom={async (e) => {