Deep copy pg_history and prev_pgs before mutation

This commit is contained in:
Vitaliy Filippov
2026-05-18 01:17:56 +03:00
parent 0007a831b6
commit 89df98ee08
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -627,7 +627,7 @@ class Mon
if (this.state.pg.history[pool_id] &&
this.state.pg.history[pool_id][pg])
{
pg_history[pg-1] = this.state.pg.history[pool_id][pg];
pg_history[pg-1] = JSON.parse(JSON.stringify(this.state.pg.history[pool_id][pg]));
}
}
const real_prev_pgs = [];
+1 -1
View File
@@ -102,7 +102,7 @@ function scale_pg_count(prev_pgs, new_pg_count)
{
for (let i = prev_pgs.length; i < new_pg_count; i++)
{
prev_pgs[i] = prev_pgs[i % prev_pgs.length];
prev_pgs[i] = [ ...prev_pgs[i % prev_pgs.length] ];
}
}
else if (prev_pgs.length > new_pg_count)