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:
1 parent
60595f3455
commit
8a70b8d85c
1 file changed
+2
-2
@@ -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