chore: select the first workspace app to be active in tasks (#18256)

Same as https://github.com/coder/coder/pull/18239, but only the
necessary code
This commit is contained in:
Hugo Dutka
2025-06-05 13:40:01 -05:00
committed by GitHub
parent 60595f3455
commit 8a70b8d85c
+2 -2
View File
@@ -33,9 +33,9 @@ export const TaskApps: FC<TaskAppsProps> = ({ task }) => {
.filter((a) => !!a && a.slug !== AI_APP_CHAT_SLUG);
const [activeAppId, setActiveAppId] = useState<string>(() => {
const appId = task.workspace.latest_app_status?.app_id;
const appId = apps[0]?.id;
if (!appId) {
throw new Error("No active app found in task");
throw new Error("No apps found in task");
}
return appId;
});