diff --git a/packages/desktop/src/main/browser/profiling.ts b/packages/desktop/src/main/browser/profiling.ts index 2a120938de5..f8e27b25ba1 100644 --- a/packages/desktop/src/main/browser/profiling.ts +++ b/packages/desktop/src/main/browser/profiling.ts @@ -56,11 +56,10 @@ export function createProfiling(contents: WebContents, cdp: Cdp, files: BrowserF ), ) if (cpu.result) return cpu.result + const resources = cpu.resources clearTimeout(cpu.timer) cpu.result = cdp.send("Profiler.stop").then(async ({ profile }) => ({ - id: await files.save("profile.cpuprofile", "application/json", Buffer.from(JSON.stringify(profile)), [ - ...(cpu?.resources ?? []), - ]), + id: await files.save("profile.cpuprofile", "application/json", Buffer.from(JSON.stringify(profile)), [...resources]), durationMs: (profile.endTime - profile.startTime) / 1000, })) return cpu.result