diff --git a/apps/code/scripts/patch-electron-name.sh b/apps/code/scripts/patch-electron-name.sh index e0523c82e..940dbad54 100755 --- a/apps/code/scripts/patch-electron-name.sh +++ b/apps/code/scripts/patch-electron-name.sh @@ -10,10 +10,10 @@ if [ ! -f "$PLIST_FILE" ]; then exit 0 fi -if /usr/libexec/PlistBuddy -c "Print :CFBundleName" "$PLIST_FILE" | grep -q "Array (Development)"; then +if /usr/libexec/PlistBuddy -c "Print :CFBundleName" "$PLIST_FILE" | grep -q "PostHog Code (Development)"; then exit 0 fi -/usr/libexec/PlistBuddy -c "Set :CFBundleName 'Array (Development)'" "$PLIST_FILE" -/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName 'Array (Development)'" "$PLIST_FILE" +/usr/libexec/PlistBuddy -c "Set :CFBundleName 'PostHog Code (Development)'" "$PLIST_FILE" +/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName 'PostHog Code (Development)'" "$PLIST_FILE" /usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier 'com.posthog.array.dev'" "$PLIST_FILE" diff --git a/apps/code/src/renderer/features/auth/hooks/authMutations.ts b/apps/code/src/renderer/features/auth/hooks/authMutations.ts index c2d05f483..f9705b340 100644 --- a/apps/code/src/renderer/features/auth/hooks/authMutations.ts +++ b/apps/code/src/renderer/features/auth/hooks/authMutations.ts @@ -76,13 +76,13 @@ export function useLogoutMutation() { track(ANALYTICS_EVENTS.USER_LOGGED_OUT); resetSessionService(); - clearAuthScopedQueries(); const state = await trpcClient.auth.logout.mutate(); return { state, previousState }; }, onSuccess: async ({ previousState }) => { await refreshAuthStateQuery(); + clearAuthScopedQueries(); useAuthUiStateStore.getState().setStaleRegion(previousState.cloudRegion); useNavigationStore.getState().navigateToTaskInput(); useOnboardingStore.getState().resetSelections(); diff --git a/apps/code/src/renderer/features/command-center/hooks/useCommandCenterData.ts b/apps/code/src/renderer/features/command-center/hooks/useCommandCenterData.ts index ff6838d6a..a89d79d51 100644 --- a/apps/code/src/renderer/features/command-center/hooks/useCommandCenterData.ts +++ b/apps/code/src/renderer/features/command-center/hooks/useCommandCenterData.ts @@ -87,7 +87,7 @@ export function useCommandCenterData(): { }, [storeCells, taskMap, sessionByTaskId]); const summary = useMemo(() => { - const populated = cells.filter((c) => c.taskId); + const populated = cells.filter((c) => c.taskId && c.task); return { total: populated.length, running: populated.filter((c) => c.status === "running").length, diff --git a/apps/code/src/renderer/features/sidebar/components/SidebarMenu.tsx b/apps/code/src/renderer/features/sidebar/components/SidebarMenu.tsx index 317adac64..b6214297d 100644 --- a/apps/code/src/renderer/features/sidebar/components/SidebarMenu.tsx +++ b/apps/code/src/renderer/features/sidebar/components/SidebarMenu.tsx @@ -63,9 +63,14 @@ function SidebarMenuComponent() { (r) => r.status === "ready", ).length; + const taskMap = new Map(); + for (const task of allTasks) { + taskMap.set(task.id, task); + } + const commandCenterCells = useCommandCenterStore((s) => s.cells); const commandCenterActiveCount = commandCenterCells.filter( - (taskId) => taskId != null, + (taskId) => taskId != null && taskMap.has(taskId), ).length; const previousTaskIdRef = useRef(null); @@ -88,11 +93,6 @@ function SidebarMenuComponent() { previousTaskIdRef.current = currentTaskId; }, [view, markAsViewed]); - const taskMap = new Map(); - for (const task of allTasks) { - taskMap.set(task.id, task); - } - const handleNewTaskClick = () => { navigateToTaskInput(); };