Skip to content

Commit 8b615f4

Browse files
authored
fix: disable agent app buttons while a blocking startup script is running (coder#13667)
1 parent 093ec3d commit 8b615f4

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

site/src/modules/resources/AppLink/AppLink.stories.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,15 @@ export const InternalApp: Story = {
151151
agent: MockWorkspaceAgent,
152152
},
153153
};
154+
155+
export const BlockingStartupScriptRunning: Story = {
156+
args: {
157+
workspace: MockWorkspace,
158+
app: MockWorkspaceApp,
159+
agent: {
160+
...MockWorkspaceAgent,
161+
lifecycle_state: "starting",
162+
startup_script_behavior: "blocking",
163+
},
164+
},
165+
};

site/src/modules/resources/AppLink/AppLink.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,19 @@ export const AppLink: FC<AppLinkProps> = ({ app, workspace, agent }) => {
9494
}
9595
if (!appsHost && app.subdomain) {
9696
canClick = false;
97-
icon = (
98-
<ErrorOutlineIcon
99-
css={{
100-
color: theme.palette.grey[300],
101-
}}
102-
/>
103-
);
97+
icon = <ErrorOutlineIcon css={{ color: theme.palette.grey[300] }} />;
10498
primaryTooltip =
10599
"Your admin has not configured subdomain application access";
106100
}
107101
if (fetchingSessionToken) {
108102
canClick = false;
109103
}
104+
if (
105+
agent.lifecycle_state === "starting" &&
106+
agent.startup_script_behavior === "blocking"
107+
) {
108+
canClick = false;
109+
}
110110

111111
const isPrivateApp = app.sharing_level === "owner";
112112

0 commit comments

Comments
 (0)