Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

fix(app): update logs on sketchId change

dextmorgn0bc52416d9f9
diff --git a/flowsint-app/src/hooks/use-events.ts b/flowsint-app/src/hooks/use-events.ts
index 93236b5a..f87f66df 100644
--- a/flowsint-app/src/hooks/use-events.ts
+++ b/flowsint-app/src/hooks/use-events.ts
@@ -16,9 +16,7 @@ export function useEvents(sketch_id: string | undefined) {
const { data: previousLogs = [], refetch } = useQuery({
queryKey: queryKeys.logs.bySketch(sketch_id as string),
queryFn: () => logService.get(sketch_id as string),
- refetchOnWindowFocus: false,
enabled: !!sketch_id,
- staleTime: 30_000
})
const handleRefresh = () => {
@@ -26,6 +24,11 @@ export function useEvents(sketch_id: string | undefined) {
setLiveLogs([]) // Pour éviter les doublons dans les logs live
}
+ // Reset live logs when sketch_id changes
+ useEffect(() => {
+ setLiveLogs([])
+ }, [sketch_id])
+
useEffect(() => {
if (!sketch_id) return