continue scaffolding and refine the basic foundation
This commit is contained in:
@@ -3,18 +3,16 @@ import type { Agent } from '~~/types'
|
||||
|
||||
export const useAgents = async () => {
|
||||
const { addTask, completeTask } = useTasks()
|
||||
const appState = useAppState()
|
||||
|
||||
const fetchingAgents = ref(false);
|
||||
const agents: Ref<Agent[] | null> = useState('agents', () => null);
|
||||
|
||||
const activeAgent = computed(() => {
|
||||
if (agents.value === null) return;
|
||||
if (!appState.activeAgentId.value) return;
|
||||
|
||||
const routeId = useRoute().params.id;
|
||||
if (routeId === undefined) return;
|
||||
|
||||
const agent = agents.value.find(agent => agent.id === routeId);
|
||||
if (agent === undefined) return;
|
||||
|
||||
const agent = agents.value.find(agent => agent.id === appState.activeAgentId.value);
|
||||
return agent;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user