mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
chore: select the first embedded app on tasks page (#18260)
The first app might be an external app (shown in the dropdown), and we actually want to select the first embedded app (which are in tabs).
This commit is contained in:
@@ -32,8 +32,11 @@ export const TaskApps: FC<TaskAppsProps> = ({ task }) => {
|
||||
.flatMap((a) => a?.apps)
|
||||
.filter((a) => !!a && a.slug !== AI_APP_CHAT_SLUG);
|
||||
|
||||
const embeddedApps = apps.filter((app) => !app.external);
|
||||
const externalApps = apps.filter((app) => app.external);
|
||||
|
||||
const [activeAppId, setActiveAppId] = useState<string>(() => {
|
||||
const appId = apps[0]?.id;
|
||||
const appId = embeddedApps[0]?.id;
|
||||
if (!appId) {
|
||||
throw new Error("No apps found in task");
|
||||
}
|
||||
@@ -52,9 +55,6 @@ export const TaskApps: FC<TaskAppsProps> = ({ task }) => {
|
||||
throw new Error(`Agent for app ${activeAppId} not found in task workspace`);
|
||||
}
|
||||
|
||||
const embeddedApps = apps.filter((app) => !app.external);
|
||||
const externalApps = apps.filter((app) => app.external);
|
||||
|
||||
return (
|
||||
<main className="flex-1 flex flex-col">
|
||||
<div className="border-0 border-b border-border border-solid w-full p-1 flex gap-2">
|
||||
|
||||
Reference in New Issue
Block a user