mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
fix(ui): improve React Query hooks and fix edge cases
- Update query keys to include all relevant parameters (branches, agents) - Fix use-branches to pass includeRemote parameter to query key - Fix use-settings to include sources in agents query key - Update running-agents-view to use correct query key structure - Update use-spec-loading to properly use spec query hooks - Add missing queryClient invalidation in auto-mode mutations - Add missing cache invalidation in spec mutations after creation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -157,6 +157,11 @@ export function useSaveSpec(projectPath: string) {
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async (content: string) => {
|
||||
// Guard against empty projectPath to prevent writing to invalid locations
|
||||
if (!projectPath || projectPath.trim() === '') {
|
||||
throw new Error('Invalid project path: cannot save spec without a valid project');
|
||||
}
|
||||
|
||||
const api = getElectronAPI();
|
||||
|
||||
await api.writeFile(`${projectPath}/.automaker/app_spec.txt`, content);
|
||||
|
||||
Reference in New Issue
Block a user