Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): Reconnect on a switched-off environment switches it back on #24691

MergedJacksondr5(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/24691/headmerged by maria-rcks View on GitHub

Showing 1 changed file with 5 additions and 1 deletion.

x
0 of 1 viewed, 1 left
5 additions and 1 deletionapps/web/src/components/chat/useSystemComposerBanners.tsxModified
View file
@@ -105,7 +105,11 @@
}, [activeReconnectingEnvironmentId]);
const handleReconnectActiveEnvironment = async (environmentId: EnvironmentId) => {
- const result = await retryEnvironment(environmentId);
+ // A retry does nothing while the environment is switched off.
+ const result =
+ activeEnvironment?.entry.enabled === false
+ ? await setEnvironmentEnabled({ environmentId, enabled: true })
+ : await retryEnvironment(environmentId);
if (result._tag === "Failure" && !isAtomCommandInterrupted(result)) {
const error = squashAtomCommandFailure(result);
toastManager.add(