Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix([issue-1086]): address claude review — guard useSidebarApps unmount + name sort

Adam Eivy966937fc47e2
diff --git a/client/src/hooks/useSidebarApps.js b/client/src/hooks/useSidebarApps.js
index 4013a94311..d3c1faf04b 100644
--- a/client/src/hooks/useSidebarApps.js
+++ b/client/src/hooks/useSidebarApps.js
@@ -9,12 +9,14 @@ import socket from '../services/socket';
export function useSidebarApps() {
const [apps, setApps] = useState([]);
useEffect(() => {
+ let cancelled = false;
const fetchApps = () => {
api.getApps({ silent: true })
.then((result) => {
+ if (cancelled) return;
setApps((result || [])
.filter((a) => !a.archived)
- .sort((a, b) => a.name.localeCompare(b.name)));
+ .sort((a, b) => (a.name || '').localeCompare(b.name || '')));
})
.catch((err) => {
console.warn(`⚠️ Layout: getApps refresh failed: ${err?.message || err}`);
@@ -22,7 +24,10 @@ export function useSidebarApps() {
};
fetchApps();
socket.on('apps:changed', fetchApps);
- return () => socket.off('apps:changed', fetchApps);
+ return () => {
+ cancelled = true;
+ socket.off('apps:changed', fetchApps);
+ };
}, []);
return apps;
}