Skip to content

Commit b711018

Browse files
committed
Improve canAutoStart check
1 parent 24c7552 commit b711018

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

site/src/pages/WorkspacePage/WorkspaceNotifications.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ export const WorkspaceNotifications: FC<WorkspaceNotificationsProps> = (
5151
const notifications: Notification[] = [];
5252

5353
// Outdated
54-
const canAutostartResponse = useQuery(
55-
workspaceResolveAutostart(workspace.id),
56-
);
57-
const canAutostart = !canAutostartResponse.data?.parameter_mismatch ?? false;
54+
const canAutostartQuery = useQuery(workspaceResolveAutostart(workspace.id));
55+
const isParameterMismatch =
56+
canAutostartQuery.data?.parameter_mismatch ?? false;
57+
const canAutostart = !isParameterMismatch;
5858
const updateRequired =
5959
(workspace.template_require_active_version ||
6060
workspace.automatic_updates === "always") &&

0 commit comments

Comments
 (0)