diff --git a/desktop/src/views/Pro/Workspace/Workspace.tsx b/desktop/src/views/Pro/Workspace/Workspace.tsx
index 37fb8da94..a45dabb3c 100644
--- a/desktop/src/views/Pro/Workspace/Workspace.tsx
+++ b/desktop/src/views/Pro/Workspace/Workspace.tsx
@@ -103,6 +103,17 @@ export function Workspace() {
}
}, [host, navigate, workspace])
+ const { store: storeTroubleshoot } = useStoreTroubleshoot()
+
+ const handleTroubleshootClicked = useCallback(() => {
+ if (workspace.data && workspaceActions) {
+ storeTroubleshoot({
+ workspace: workspace.data,
+ workspaceActions: workspaceActions,
+ })
+ }
+ }, [storeTroubleshoot, workspace.data, workspaceActions])
+
if (!instance) {
return (
@@ -117,9 +128,6 @@ export function Workspace() {
)
}
-
- const { store: storeTroubleshoot } = useStoreTroubleshoot()
-
const canStop =
instance.status?.lastWorkspaceStatus != "Busy" &&
instance.status?.lastWorkspaceStatus != "Stopped"
@@ -135,15 +143,6 @@ export function Workspace() {
const lastActivity = getLastActivity(instance)
- const handleTroubleshootClicked = useCallback(() => {
- if (workspace.data && workspaceActions) {
- storeTroubleshoot({
- workspace: workspace.data,
- workspaceActions: workspaceActions,
- })
- }
- }, [storeTroubleshoot, workspace.data, workspaceActions])
-
return (
<>