Skip to content

[IMPROVEMENT] Migrate deprecated keep-awake methods in JitsiMeetView and AudioPlayer#7409

Open
kumarbisen wants to merge 1 commit into
RocketChat:developfrom
kumarbisen:develop
Open

[IMPROVEMENT] Migrate deprecated keep-awake methods in JitsiMeetView and AudioPlayer#7409
kumarbisen wants to merge 1 commit into
RocketChat:developfrom
kumarbisen:develop

Conversation

@kumarbisen

Copy link
Copy Markdown

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.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants