1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
Zhiyuan Zheng
2021-12-18 19:59:38 +01:00
parent ad6c6a98b6
commit 8c9dfb839b
23 changed files with 126 additions and 112 deletions

View File

@ -33,24 +33,18 @@ const AccessibilityManager: React.FC = ({ children }) => {
useEffect(() => {
loadAccessibilityInfo()
AccessibilityInfo.addEventListener(
const reduceMotionSubscription = AccessibilityInfo.addEventListener(
'reduceMotionChanged',
handleReduceMotionChanged
)
AccessibilityInfo.addEventListener(
const screenReaderSubscription = AccessibilityInfo.addEventListener(
'screenReaderChanged',
handleScreenReaderEnabled
)
return () => {
AccessibilityInfo.removeEventListener(
'reduceMotionChanged',
handleReduceMotionChanged
)
AccessibilityInfo.removeEventListener(
'screenReaderChanged',
handleScreenReaderEnabled
)
reduceMotionSubscription.remove()
screenReaderSubscription.remove()
}
}, [])