-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix false positives in toast (#5127)
* fix false positives in toast * cleanup * schema bugfix * use suspense and events * add grid handling, cleanup * yolo * fetch cleanup * lint --------- Co-authored-by: Benjamin Kane <[email protected]>
- Loading branch information
1 parent
9a13da7
commit c96506e
Showing
12 changed files
with
158 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/packages/core/src/components/Filters/use-query-performance-timeout.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { pathCanBeOptimized } from "@fiftyone/state"; | ||
import { useEffect } from "react"; | ||
import { useRecoilValue } from "recoil"; | ||
import { QP_WAIT, QueryPerformanceToastEvent } from "../QueryPerformanceToast"; | ||
|
||
export default function useQueryPerformanceTimeout( | ||
modal: boolean, | ||
path: string | ||
) { | ||
const shouldOptimize = useRecoilValue(pathCanBeOptimized(path)); | ||
useEffect(() => { | ||
if (modal || !shouldOptimize) { | ||
return; | ||
} | ||
|
||
const timeout = setTimeout(() => { | ||
window.dispatchEvent( | ||
new QueryPerformanceToastEvent(path, shouldOptimize.isFrameField) | ||
); | ||
}, QP_WAIT); | ||
|
||
return () => { | ||
clearTimeout(timeout); | ||
}; | ||
}, [modal, path, shouldOptimize]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.