Skip to content

Commit c339066

Browse files
authored
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).
1 parent 0428c5e commit c339066

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

site/src/pages/TaskPage/TaskApps.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ export const TaskApps: FC<TaskAppsProps> = ({ task }) => {
3232
.flatMap((a) => a?.apps)
3333
.filter((a) => !!a && a.slug !== AI_APP_CHAT_SLUG);
3434

35+
const embeddedApps = apps.filter((app) => !app.external);
36+
const externalApps = apps.filter((app) => app.external);
37+
3538
const [activeAppId, setActiveAppId] = useState<string>(() => {
36-
const appId = apps[0]?.id;
39+
const appId = embeddedApps[0]?.id;
3740
if (!appId) {
3841
throw new Error("No apps found in task");
3942
}
@@ -52,9 +55,6 @@ export const TaskApps: FC<TaskAppsProps> = ({ task }) => {
5255
throw new Error(`Agent for app ${activeAppId} not found in task workspace`);
5356
}
5457

55-
const embeddedApps = apps.filter((app) => !app.external);
56-
const externalApps = apps.filter((app) => app.external);
57-
5858
return (
5959
<main className="flex-1 flex flex-col">
6060
<div className="border-0 border-b border-border border-solid w-full p-1 flex gap-2">

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy