Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const AccessibilityInfo = {
reject,
);
} else {
reject(null);
reject(new Error('NativeAccessibilityManagerIOS is not available'));
}
});
}
Expand All @@ -119,7 +119,11 @@ const AccessibilityInfo = {
if (NativeAccessibilityInfoAndroid?.isGrayscaleEnabled != null) {
NativeAccessibilityInfoAndroid.isGrayscaleEnabled(resolve);
} else {
reject(null);
reject(
new Error(
'NativeAccessibilityInfoAndroid.isGrayscaleEnabled is not available',
),
);
}
});
} else {
Expand All @@ -130,7 +134,7 @@ const AccessibilityInfo = {
reject,
);
} else {
reject(null);
reject(new Error('AccessibilityInfo native module is not available'));
}
});
}
Expand All @@ -150,7 +154,11 @@ const AccessibilityInfo = {
if (NativeAccessibilityInfoAndroid?.isInvertColorsEnabled != null) {
NativeAccessibilityInfoAndroid.isInvertColorsEnabled(resolve);
} else {
reject(null);
reject(
new Error(
'NativeAccessibilityInfoAndroid.isInvertColorsEnabled is not available',
),
);
}
});
} else {
Expand All @@ -161,7 +169,7 @@ const AccessibilityInfo = {
reject,
);
} else {
reject(null);
reject(new Error('AccessibilityInfo native module is not available'));
}
});
}
Expand All @@ -181,7 +189,7 @@ const AccessibilityInfo = {
if (NativeAccessibilityInfoAndroid != null) {
NativeAccessibilityInfoAndroid.isReduceMotionEnabled(resolve);
} else {
reject(null);
reject(new Error('AccessibilityInfo native module is not available'));
}
} else {
if (NativeAccessibilityManagerIOS != null) {
Expand All @@ -190,7 +198,7 @@ const AccessibilityInfo = {
reject,
);
} else {
reject(null);
reject(new Error('NativeAccessibilityManagerIOS is not available'));
}
}
});
Expand All @@ -208,7 +216,11 @@ const AccessibilityInfo = {
if (NativeAccessibilityInfoAndroid?.isHighTextContrastEnabled != null) {
NativeAccessibilityInfoAndroid.isHighTextContrastEnabled(resolve);
} else {
reject(null);
reject(
new Error(
'NativeAccessibilityInfoAndroid.isHighTextContrastEnabled is not available',
),
);
}
} else {
return Promise.resolve(false);
Expand Down Expand Up @@ -236,7 +248,11 @@ const AccessibilityInfo = {
reject,
);
} else {
reject(null);
reject(
new Error(
'NativeAccessibilityManagerIOS.getCurrentDarkerSystemColorsState is not available',
),
);
}
}
});
Expand Down Expand Up @@ -264,7 +280,11 @@ const AccessibilityInfo = {
reject,
);
} else {
reject(null);
reject(
new Error(
'NativeAccessibilityManagerIOS.getCurrentPrefersCrossFadeTransitionsState is not available',
),
);
}
}
});
Expand All @@ -289,7 +309,7 @@ const AccessibilityInfo = {
reject,
);
} else {
reject(null);
reject(new Error('NativeAccessibilityManagerIOS is not available'));
}
});
}
Expand All @@ -309,7 +329,7 @@ const AccessibilityInfo = {
if (NativeAccessibilityInfoAndroid != null) {
NativeAccessibilityInfoAndroid.isTouchExplorationEnabled(resolve);
} else {
reject(null);
reject(new Error('NativeAccessibilityInfoAndroid is not available'));
}
} else {
if (NativeAccessibilityManagerIOS != null) {
Expand All @@ -318,7 +338,7 @@ const AccessibilityInfo = {
reject,
);
} else {
reject(null);
reject(new Error('NativeAccessibilityManagerIOS is not available'));
}
}
});
Expand All @@ -343,10 +363,18 @@ const AccessibilityInfo = {
) {
NativeAccessibilityInfoAndroid.isAccessibilityServiceEnabled(resolve);
} else {
reject(null);
reject(
new Error(
'NativeAccessibilityInfoAndroid.isAccessibilityServiceEnabled is not available',
),
);
}
} else {
reject(null);
reject(
new Error(
'isAccessibilityServiceEnabled is only available on Android',
),
);
}
});
},
Expand Down
Loading