()
| 493 | |
| 494 | // Update file dialog active state when the window is focused on |
| 495 | const onWindowFocus = () => { |
| 496 | // Execute the timeout only if the file dialog is opened in the browser |
| 497 | if (!fsAccessApiWorksRef.current && isFileDialogActive) { |
| 498 | setTimeout(() => { |
| 499 | if (inputRef.current) { |
| 500 | const { files } = inputRef.current; |
| 501 | |
| 502 | if (!files.length) { |
| 503 | dispatch({ type: "closeDialog" }); |
| 504 | onFileDialogCancelCb(); |
| 505 | } |
| 506 | } |
| 507 | }, 300); |
| 508 | } |
| 509 | }; |
| 510 | useEffect(() => { |
| 511 | window.addEventListener("focus", onWindowFocus, false); |
| 512 | return () => { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…