Skip to content

Commit c02c0a7

Browse files
committed
Fix CI lint/prettier and avoid perf test regression
1 parent 61b9e63 commit c02c0a7

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/components/Modal/BaseModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ function BaseModal({
269269
],
270270
);
271271

272-
const shouldShowBottomDockedDismissButton =
273-
isSmallScreenWidth && type === CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED && !!(onBackdropPress ?? onClose) && isScreenReaderEnabled;
272+
const shouldShowBottomDockedDismissButton = isSmallScreenWidth && type === CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED && !!(onBackdropPress ?? onClose) && isScreenReaderEnabled;
274273

275274
const initialFocusTarget = useMemo(() => {
276275
if (!isWeb || !shouldShowBottomDockedDismissButton) {
@@ -422,6 +421,7 @@ function BaseModal({
422421
onPress={handleBackdropPress}
423422
accessibilityRole={CONST.ROLE.BUTTON}
424423
accessibilityLabel={translate('modal.dismissDialog')}
424+
sentryLabel="Modal-DismissDialog"
425425
style={styles.bottomDockedModalDismissButton}
426426
shouldUseAutoHitSlop
427427
>

src/libs/Accessibility/index.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,23 @@ const useScreenReaderStatus = (): boolean => {
99
const [isScreenReaderEnabled, setIsScreenReaderEnabled] = useState(false);
1010
useEffect(() => {
1111
let isMounted = true;
12-
AccessibilityInfo.isScreenReaderEnabled()
13-
.then((enabled) => {
14-
if (!isMounted) {
15-
return;
16-
}
17-
setIsScreenReaderEnabled(enabled);
18-
})
19-
.catch(() => {});
12+
const isScreenReaderEnabledAsync = AccessibilityInfo.isScreenReaderEnabled;
13+
if (isScreenReaderEnabledAsync) {
14+
isScreenReaderEnabledAsync()
15+
.then((enabled) => {
16+
if (!isMounted) {
17+
return;
18+
}
2019

20+
setIsScreenReaderEnabled(enabled);
21+
})
22+
.catch(() => {});
23+
}
2124
const subscription = AccessibilityInfo.addEventListener('screenReaderChanged', (enabled) => {
2225
if (!isMounted) {
2326
return;
2427
}
28+
2529
setIsScreenReaderEnabled(enabled);
2630
});
2731

0 commit comments

Comments
 (0)