[IMPROVEMENT] Migrate deprecated keep-awake methods in JitsiMeetView and AudioPlayer#7409
Open
kumarbisen wants to merge 1 commit into
Open
[IMPROVEMENT] Migrate deprecated keep-awake methods in JitsiMeetView and AudioPlayer#7409kumarbisen wants to merge 1 commit into
kumarbisen wants to merge 1 commit into
Conversation
|
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a code quality improvement that addresses deprecations in the expo-keep-awake library across two components: JitsiMeetView and AudioPlayer.
Improvements included:
JitsiMeetView: Replaced the deprecated activateKeepAwake and deactivateKeepAwake calls inside the useEffect lifecycle with the recommended useKeepAwake hook, properly placing it at the top level of the component to conform to React's rules of hooks.
AudioPlayer: Replaced the deprecated activateKeepAwake method with the asynchronous activateKeepAwakeAsync() method within the useEffect conditionally tracking the audio paused state. This correctly keeps the screen active only while audio is playing.
How Has This Been Tested?
Tested locally on simulator/device to ensure the screen continues to properly stay awake when navigating to the Jitsi meeting view or playing an audio message, and that pnpm lint and pnpm test successfully pass without rules-of-hooks errors.
Checklist
I have read the CONTRIBUTING doc
I have signed the CLA
Lint and unit tests pass locally with my changes
I have added tests that prove my fix is effective or that my feature works (if applicable)
I have added necessary documentation (if applicable)
Any dependent changes have been merged and published in downstream modules
Further comments
This is a straightforward deprecation migration to keep the codebase up to date with modern expo-keep-awake API standards and ensure strict compliance with React's Rules of Hooks in the case of JitsiMeetView.