git
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
import { api } from "../../lib/api.js";
|
||||
import { selectedTask } from "../../lib/stores.js";
|
||||
import { resumeTask } from "../../services/taskService.js";
|
||||
import { environmentContextStore } from '$lib/stores/environmentContext.js';
|
||||
import type {
|
||||
DashboardMetadata,
|
||||
DashboardSelection,
|
||||
@@ -88,6 +89,7 @@
|
||||
// [/SECTION]
|
||||
|
||||
const selectedTaskState = fromStore(selectedTask);
|
||||
const envContextState = fromStore(environmentContextStore);
|
||||
|
||||
const belief_scope = <T>(_id: string, fn: () => T): T => fn();
|
||||
|
||||
@@ -104,6 +106,11 @@
|
||||
console.info("[EXT:frontend:fetchEnvironments][REASON] Initializing environment list for selection");
|
||||
try {
|
||||
environments = await api.getEnvironmentsList();
|
||||
// Pre-fill source with active environment, leave target empty
|
||||
const activeEnvId = envContextState.current?.selectedEnvId;
|
||||
if (activeEnvId && environments.some((env) => env.id === activeEnvId)) {
|
||||
sourceEnvId = activeEnvId;
|
||||
}
|
||||
console.info("[EXT:frontend:fetchEnvironments][REFLECT] Environments loaded", { count: environments.length });
|
||||
} catch (e) {
|
||||
console.error("[EXT:frontend:fetchEnvironments][EXPLORE] Failed to fetch environments", e);
|
||||
|
||||
Reference in New Issue
Block a user