fix: brightness issue #299

This commit is contained in:
Saif Shaikh 2026-01-13 05:30:56 -08:00
parent 5ff8ebca92
commit 0cd94da7ce

View file

@ -112,10 +112,14 @@ export const usePlayerSetup = (
subscription?.remove();
disableImmersiveMode();
// Restore brightness on unmount
if (Platform.OS === 'android' && originalSystemBrightnessRef.current !== null) {
// restoration logic normally happens here or in a separate effect
async function restoreBrightness() {
logger.log('yobrrrrrrrrrrrrrr');
await Brightness.setBrightnessAsync(originalSystemBrightnessRef.current!).then();
setBrightness(originalSystemBrightnessRef.current!);
}
// Restore brightness on unmount
if (Platform.OS === 'android' && originalSystemBrightnessRef.current !== null)
restoreBrightness();
};
}, []);