Skip to content

Commit

Permalink
replace announceForAccessibility() with announceForAccessibilityWithO…
Browse files Browse the repository at this point in the history
…ptions()
  • Loading branch information
1010nishant committed Jan 20, 2023
1 parent 966c36a commit c0f31ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/boot/OfflineNoticeProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ export function OfflineNoticeProvider(props: ProviderProps): Node {
if (shouldShowUncertaintyNotice && !haveAnnouncedUncertain.current) {
// TODO(react-native-68): Use announceForAccessibilityWithOptions to
// queue this behind any in-progress announcements
AccessibilityInfo.announceForAccessibility(_('Zulip’s Internet connection is uncertain.'));
AccessibilityInfo.announceForAccessibilityWithOptions(_('Zulip’s Internet connection is uncertain.'), { queue: true });
haveAnnouncedUncertain.current = true;
}

if (isOnline === false && (!haveAnnouncedOffline.current || haveAnnouncedUncertain.current)) {
AccessibilityInfo.announceForAccessibility(_('Zulip is offline.'));
AccessibilityInfo.announceForAccessibilityWithOptions(_('Zulip is offline.'), { queue: false });
haveAnnouncedOffline.current = true;
haveAnnouncedUncertain.current = false;
} else if (
Expand All @@ -228,7 +228,8 @@ export function OfflineNoticeProvider(props: ProviderProps): Node {
) {
// TODO(react-native-68): Use announceForAccessibilityWithOptions to
// queue this behind any in-progress announcements
AccessibilityInfo.announceForAccessibility(_('Zulip is online.'));
AccessibilityInfo.announceForAccessibilityWithOptions(_('Zulip is online.'), { queue: true });

haveAnnouncedOffline.current = false;
haveAnnouncedUncertain.current = false;
}
Expand Down

0 comments on commit c0f31ea

Please sign in to comment.