Skip to content

Commit

Permalink
NotifTroubleshootingScreen: Add NavRow linking to troubleshooting guide
Browse files Browse the repository at this point in the history
Fixes-partly: zulip#5785
  • Loading branch information
chrisbobbe committed Jan 4, 2024
1 parent 944fee6 commit ebfb850
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/settings/NotifTroubleshootingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import isAppOwnDomain from '../isAppOwnDomain';
import { openLinkWithUserPreference, openSystemNotificationSettings } from '../utils/openLink';
import { initNotifications } from '../notification/notifTokens';
import { ApiError } from '../api/apiErrors';
import NavRow from '../common/NavRow';
import RowGroup from '../common/RowGroup';
import TextRow from '../common/TextRow';

Expand Down Expand Up @@ -464,6 +465,13 @@ export default function NotifTroubleshootingScreen(props: Props): React.Node {

const mailComposerIsAvailable = useMailComposerIsAvailable();

const handlePressTroubleshootingGuide = React.useCallback(() => {
openLinkWithUserPreference(
new URL('https://zulip.com/help/mobile-notifications#troubleshooting-mobile-notifications'),
settings,
);
}, [settings]);

const handlePressEmailSupport = React.useCallback(async () => {
const result = await MailComposer.composeAsync({
recipients: ['support@zulip.com'],
Expand Down Expand Up @@ -619,6 +627,13 @@ export default function NotifTroubleshootingScreen(props: Props): React.Node {
<RowGroup>
{(() => {
const children = [];
children.push(
<NavRow
type="external"
title="Troubleshooting guide"
onPress={handlePressTroubleshootingGuide}
/>,
);
if (mailComposerIsAvailable === true) {
children.push(
<TextRow
Expand Down
1 change: 1 addition & 0 deletions static/translations/messages_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
"Please tap “{troubleshootingPageTitle}” for more details.": "Please tap “{troubleshootingPageTitle}” for more details.",
"Request in progress": "Request in progress",
"Please wait. A request is already in progress.": "Please wait. A request is already in progress.",
"Troubleshooting guide": "Troubleshooting guide",
"Email {supportEmail}": "Email {supportEmail}",
"Draft saved": "Draft saved",
"Email sent": "Email sent",
Expand Down

0 comments on commit ebfb850

Please sign in to comment.