File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
site/src/pages/WorkspacePage Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { ErrorAlert } from "components/Alert/ErrorAlert";
9
9
import { useOrganizationId } from "hooks" ;
10
10
import { isAxiosError } from "axios" ;
11
11
import { Margins } from "components/Margins/Margins" ;
12
- import { workspaceResolveAutostart } from "api/queries/workspaceQuota" ;
13
12
import { useInfiniteQuery , useQuery } from "react-query" ;
14
13
import { infiniteWorkspaceBuilds } from "api/queries/workspaceBuilds" ;
15
14
import { templateByName } from "api/queries/templates" ;
@@ -65,11 +64,6 @@ export const WorkspacePage: FC = () => {
65
64
const pageError =
66
65
workspaceQuery . error ?? templateQuery . error ?? permissionsQuery . error ;
67
66
const isLoading = ! workspace || ! template || ! permissions ;
68
- const canAutostartResponse = useQuery (
69
- workspaceResolveAutostart ( workspace ?. id ?? "" ) ,
70
- ) ;
71
-
72
- const canAutostart = ! canAutostartResponse . data ?. parameter_mismatch ?? false ;
73
67
74
68
if ( pageError ) {
75
69
return (
@@ -102,7 +96,6 @@ export const WorkspacePage: FC = () => {
102
96
await buildsQuery . fetchNextPage ( ) ;
103
97
} }
104
98
hasMoreBuilds = { Boolean ( buildsQuery . hasNextPage ) }
105
- canAutostart = { canAutostart }
106
99
/>
107
100
</ RequirePermission >
108
101
) ;
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import { getErrorMessage } from "api/errors";
38
38
import { displaySuccess , displayError } from "components/GlobalSnackbar/utils" ;
39
39
import { deploymentConfig } from "api/queries/deployment" ;
40
40
import { WorkspacePermissions } from "./permissions" ;
41
+ import { workspaceResolveAutostart } from "api/queries/workspaceQuota" ;
41
42
42
43
interface WorkspaceReadyPageProps {
43
44
template : TypesGen . Template ;
@@ -53,7 +54,6 @@ interface WorkspaceReadyPageProps {
53
54
onLoadMoreBuilds : ( ) => void ;
54
55
isLoadingMoreBuilds : boolean ;
55
56
hasMoreBuilds : boolean ;
56
- canAutostart : boolean ;
57
57
}
58
58
59
59
export const WorkspaceReadyPage = ( {
@@ -67,7 +67,6 @@ export const WorkspaceReadyPage = ({
67
67
onLoadMoreBuilds,
68
68
isLoadingMoreBuilds,
69
69
hasMoreBuilds,
70
- canAutostart,
71
70
} : WorkspaceReadyPageProps ) : JSX . Element => {
72
71
const { buildInfo } = useDashboard ( ) ;
73
72
const featureVisibility = useFeatureVisibility ( ) ;
@@ -146,6 +145,11 @@ export const WorkspaceReadyPage = ({
146
145
onError : onDeadlineChangeFails ,
147
146
} ) ;
148
147
148
+ const canAutostartResponse = useQuery (
149
+ workspaceResolveAutostart ( workspace . id ) ,
150
+ ) ;
151
+ const canAutostart = ! canAutostartResponse . data ?. parameter_mismatch ?? false ;
152
+
149
153
return (
150
154
< >
151
155
< Helmet >
You can’t perform that action at this time.
0 commit comments