mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
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:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user