()
| 3 | import { useCallback } from 'react'; |
| 4 | |
| 5 | export const useScreenProtect = () => { |
| 6 | const enableScreenProtect = useCallback(async () => { |
| 7 | if (isDesktop) return; |
| 8 | await CaptureProtection.prevent(); |
| 9 | }, []); |
| 10 | |
| 11 | const disableScreenProtect = useCallback(async () => { |
| 12 | if (isDesktop) return; |
| 13 | await CaptureProtection.allow(); |
| 14 | }, []); |
| 15 | |
| 16 | const isScreenBeingRecorded = useCallback(async () => { |
| 17 | if (isDesktop) return false; |
| 18 | return await CaptureProtection.isScreenRecording(); |
| 19 | }, []); |
| 20 | |
| 21 | return { |
| 22 | enableScreenProtect, |
| 23 | disableScreenProtect, |
| 24 | isScreenBeingRecorded, |
| 25 | }; |
| 26 | }; |
no outgoing calls
no test coverage detected