fix cloning problem

This commit is contained in:
martin-mfg
2025-12-26 12:47:00 +01:00
parent 8aa490a7de
commit 0d772ff3d4
+5 -2
View File
@@ -148,8 +148,11 @@ const statsFetcher = async ({
const repoNodes = res.data.data.user.repositories.nodes;
if (stats) {
if (fetchedPages === 1) {
// make deep copy of stats to avoid altering the cached response object in frontend
stats = structuredClone(stats);
// make deep copy of relevant stats fields to avoid altering the cached response object in frontend
stats = structuredClone({
data: stats.data,
statusText: stats.statusText,
});
}
stats.data.data.user.repositories.nodes.push(...repoNodes);
} else {