chore: remove debug logging from task creation fix
This commit is contained in:
@@ -503,17 +503,13 @@ export function GitHubIssues({ onOpenSettings, onNavigateToTask }: GitHubIssuesP
|
||||
|
||||
const handleCreateTask = useCallback(async () => {
|
||||
if (!selectedProject?.id || !selectedIssue) return;
|
||||
console.log('[GitHubIssues] Creating task for issue', selectedIssue.number);
|
||||
const result = await window.electronAPI.github.createTaskFromInvestigation(
|
||||
selectedProject.id, selectedIssue.number
|
||||
);
|
||||
console.log('[GitHubIssues] Task creation result:', result);
|
||||
if (result.success && result.data?.specId) {
|
||||
console.log('[GitHubIssues] Loading tasks to ensure task list is up-to-date');
|
||||
// Load tasks FIRST so the new task is in the list when we update the store
|
||||
// This prevents the tasks-changed effect from clearing the specId due to race condition
|
||||
await loadTasks(selectedProject.id);
|
||||
console.log('[GitHubIssues] Tasks loaded, now calling setSpecId with', result.data.specId);
|
||||
// Update the investigation store with the specId so the UI knows a task was created
|
||||
investigationStore.setSpecId(selectedProject.id, selectedIssue.number, result.data.specId);
|
||||
} else if (!result.success) {
|
||||
@@ -565,10 +561,7 @@ export function GitHubIssues({ onOpenSettings, onNavigateToTask }: GitHubIssuesP
|
||||
// when setSpecId() updates the store, the component will re-render immediately
|
||||
const selectedIssueEntry = useInvestigationStore((state) => {
|
||||
if (!selectedProject?.id || !selectedIssue) return null;
|
||||
const key = `${selectedProject.id}:${selectedIssue.number}`;
|
||||
const entry = state.investigations[key] ?? null;
|
||||
console.log('[GitHubIssues] Selector called for', key, 'specId:', entry?.specId);
|
||||
return entry;
|
||||
return state.investigations[`${selectedProject.id}:${selectedIssue.number}`] ?? null;
|
||||
});
|
||||
|
||||
// Derive the state machine value from the entry
|
||||
|
||||
Reference in New Issue
Block a user