The open source coding agent.
TypeScript
fix(desktop): Fixed a reactive feedback loop in the global project cache sync (#10139)
Eric Guob29898226821
diff --git a/packages/app/src/context/global-sync.tsx b/packages/app/src/context/global-sync.tsxindex 5f0f3d76fdb..cfbaa372318 100644--- a/packages/app/src/context/global-sync.tsx+++ b/packages/app/src/context/global-sync.tsx@@ -28,6 +28,7 @@ import {batch,createContext,createEffect,+ untrack,getOwner,runWithOwner,useContext,@@ -174,8 +175,12 @@ function createGlobalSync() {createEffect(() => {if (!projectCacheReady()) return- if (globalStore.project.length === 0 && projectCache.value.length !== 0) return- setProjectCache("value", globalStore.project.map(sanitizeProject))+ const projects = globalStore.project+ if (projects.length === 0) {+ const cachedLength = untrack(() => projectCache.value.length)+ if (cachedLength !== 0) return+ }+ setProjectCache("value", projects.map(sanitizeProject))})createEffect(async () => {