diff --git a/packages/core/runtimes/hooks.ts b/packages/core/runtimes/hooks.ts index 59bded69ca..f77304f963 100644 --- a/packages/core/runtimes/hooks.ts +++ b/packages/core/runtimes/hooks.ts @@ -41,23 +41,6 @@ function runtimeNeedsUpdate( return isNewer(latestVersion, cliVersion); } -/** - * Returns true if the current user has any local runtime with an outdated CLI version. - * Accepts wsId as parameter so callers outside WorkspaceIdProvider can use it safely. - */ -export function useMyRuntimesNeedUpdate(wsId: string | undefined): boolean { - const userId = useAuthStore((s) => s.user?.id); - const { data: runtimes } = useQuery({ - ...runtimeListOptions(wsId ?? ""), - enabled: !!wsId, - }); - const { data: latestVersion } = useQuery(latestCliVersionOptions()); - - if (!runtimes || !latestVersion || !userId) return false; - - return runtimes.some((rt) => runtimeNeedsUpdate(rt, latestVersion, userId)); -} - /** * Returns a Set of runtime IDs that belong to the current user and have updates available. * Accepts wsId as parameter so callers outside WorkspaceIdProvider can use it safely. diff --git a/packages/views/layout/app-sidebar.test.tsx b/packages/views/layout/app-sidebar.test.tsx index f7687f51a6..094188e653 100644 --- a/packages/views/layout/app-sidebar.test.tsx +++ b/packages/views/layout/app-sidebar.test.tsx @@ -149,7 +149,6 @@ vi.mock("@multica/core/modals", () => ({ useModalStore: { getState: () => ({ mod vi.mock("@multica/core/pins/mutations", () => ({ useDeletePin: () => ({ mutate: deletePin }), useReorderPins: () => ({ mutate: vi.fn() }) })); vi.mock("@multica/core/pins/queries", () => ({ pinListOptions: () => ({ queryKey: ["pins"] }) })); vi.mock("@multica/core/projects/queries", () => ({ projectDetailOptions: () => ({ queryKey: ["project"] }) })); -vi.mock("@multica/core/runtimes/hooks", () => ({ useMyRuntimesNeedUpdate: () => false })); vi.mock("@multica/core/workspace/queries", () => ({ myInvitationListOptions: () => ({ queryKey: ["invitations"] }), workspaceKeys: { myInvitations: () => ["invitations"] }, diff --git a/packages/views/layout/app-sidebar.tsx b/packages/views/layout/app-sidebar.tsx index 99b2a6b1c8..b5da730443 100644 --- a/packages/views/layout/app-sidebar.tsx +++ b/packages/views/layout/app-sidebar.tsx @@ -76,7 +76,6 @@ import { chatSessionsOptions } from "@multica/core/chat/queries"; import { api, ApiError } from "@multica/core/api"; import { useModalStore } from "@multica/core/modals"; import { useConfigStore } from "@multica/core/config"; -import { useMyRuntimesNeedUpdate } from "@multica/core/runtimes/hooks"; import { pinListOptions } from "@multica/core/pins/queries"; import { useDeletePin, useReorderPins } from "@multica/core/pins/mutations"; import { issueDetailOptions } from "@multica/core/issues/queries"; @@ -394,7 +393,6 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle } // Which workspaces have unread, so the switcher dropdown can point at the // specific one(s) rather than just the aggregate avatar dot. const unreadWsIds = React.useMemo(() => unreadWorkspaceIds(unreadSummary), [unreadSummary]); - const hasRuntimeUpdates = useMyRuntimesNeedUpdate(wsId); const { data: pinnedItems = EMPTY_PINS } = useQuery({ ...pinListOptions(wsId ?? "", userId ?? ""), enabled: !!wsId && !!userId, @@ -772,9 +770,6 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle } > {t(($) => $.nav[item.labelKey])} - {item.key === "runtimes" && hasRuntimeUpdates && ( - - )} );