diff --git a/desktop/src/Theme/theme.ts b/desktop/src/Theme/theme.ts index c571ccb2e..4b2c2f5ec 100644 --- a/desktop/src/Theme/theme.ts +++ b/desktop/src/Theme/theme.ts @@ -52,7 +52,7 @@ const FormError = defineStyleConfig({ Tooltip.defaultProps = { ...Tooltip.defaultProps, placement: "top" } const getInitialColorMode = (defaultColor: ColorMode = "light"): ColorMode => { - return (localStorage.getItem("chakra-ui-color-mode") as ColorMode) ?? defaultColor + return (localStorage.getItem("chakra-ui-color-mode") as ColorMode | undefined) ?? defaultColor } export const theme = extendTheme({ diff --git a/desktop/src/client/workspaces/client.ts b/desktop/src/client/workspaces/client.ts index 28b5e373c..707bdbc13 100644 --- a/desktop/src/client/workspaces/client.ts +++ b/desktop/src/client/workspaces/client.ts @@ -181,6 +181,7 @@ export class WorkspacesClient implements TDebuggable { public async troubleshoot(ctx: TWorkspaceClientContext) { const cmd = WorkspaceCommands.TroubleshootWorkspace(ctx.id) + return cmd.run() } diff --git a/desktop/src/contexts/DevPodContext/action/actionHistory.ts b/desktop/src/contexts/DevPodContext/action/actionHistory.ts index 1b2f3394c..41f52c27d 100644 --- a/desktop/src/contexts/DevPodContext/action/actionHistory.ts +++ b/desktop/src/contexts/DevPodContext/action/actionHistory.ts @@ -1,4 +1,3 @@ -import { client } from "../../../client" import { Action, TActionObj, TActions } from "./action" const HISTORY_KEY = "devpod-workspace-action-history" diff --git a/desktop/src/views/Pro/BackToWorkspaces.tsx b/desktop/src/views/Pro/BackToWorkspaces.tsx index a042d3b51..a6c112af6 100644 --- a/desktop/src/views/Pro/BackToWorkspaces.tsx +++ b/desktop/src/views/Pro/BackToWorkspaces.tsx @@ -2,7 +2,7 @@ import { useProContext } from "@/contexts" import { Routes } from "@/routes" import { ChevronLeftIcon } from "@chakra-ui/icons" import { Link } from "@chakra-ui/react" -import { Link as RouterLink, useNavigate } from "react-router-dom" +import { Link as RouterLink } from "react-router-dom" export function BackToWorkspaces() { const { host } = useProContext() diff --git a/desktop/src/views/Pro/CreateWorkspace/InfrastructureTemplateInput.tsx b/desktop/src/views/Pro/CreateWorkspace/InfrastructureTemplateInput.tsx index a53c64198..affb3293a 100644 --- a/desktop/src/views/Pro/CreateWorkspace/InfrastructureTemplateInput.tsx +++ b/desktop/src/views/Pro/CreateWorkspace/InfrastructureTemplateInput.tsx @@ -309,6 +309,7 @@ function OptionFormField({ onChange, placeholder, displayName, + control, ]) return ( diff --git a/desktop/src/views/Pro/Workspace/WorkspaceInstanceCard.tsx b/desktop/src/views/Pro/Workspace/WorkspaceInstanceCard.tsx index 340350e23..9d23e211c 100644 --- a/desktop/src/views/Pro/Workspace/WorkspaceInstanceCard.tsx +++ b/desktop/src/views/Pro/Workspace/WorkspaceInstanceCard.tsx @@ -111,15 +111,6 @@ export function WorkspaceInstanceCard({ instanceName, host }: TWorkspaceInstance return { parameters, template: currentTemplate } }, [instance, templates]) - if (!instance) { - return null - } - - const handleOpenClicked = (ideName: string) => { - workspace.start({ id: instance.id, ideConfig: { name: ideName } }) - navigate(Routes.toProWorkspace(host, instance.id)) - } - const handleTroubleshootClicked = useCallback(() => { if (instance && workspaceActions) { storeTroubleshoot({ @@ -129,6 +120,15 @@ export function WorkspaceInstanceCard({ instanceName, host }: TWorkspaceInstance } }, [storeTroubleshoot, instance, workspaceActions]) + if (!instance) { + return null + } + + const handleOpenClicked = (ideName: string) => { + workspace.start({ id: instance.id, ideConfig: { name: ideName } }) + navigate(Routes.toProWorkspace(host, instance.id)) + } + const templateRef = instance.spec?.templateRef const isRunning = instance.status?.lastWorkspaceStatus === "Running" // TODO: Types