Skip to content

Commit

Permalink
feat: SP-1988 Go to first result when refetching after scan
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasdaloia committed Dec 27, 2024
1 parent c9f7ce3 commit 410debe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/components/ScanDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default function ScanDialog({ onOpenChange, withOptions }: ScanDialogProp
const [scanStatus, setScanStatus] = useState<ScanStatus>('idle');

const fetchResults = useResultsStore((state) => state.fetchResults);
const setSelectedResults = useResultsStore((state) => state.setSelectedResults);

const handleSelectDirectory = withErrorHandling({
asyncFn: async () => {
Expand All @@ -63,6 +64,7 @@ export default function ScanDialog({ onOpenChange, withOptions }: ScanDialogProp
setOutput([]);
await ScanStream([directory, ...args.split(' ')]);
await setScanRoot(directory);
setSelectedResults([]);
await fetchResults();
},
onError: () => {
Expand Down

0 comments on commit 410debe

Please sign in to comment.