[codex] Structure mobile external link failures (#3363)
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
eacceb9e7b
commit
d60f5c6101
7 files changed
+135
-31
No files matched your search
@@ -13,8 +13,9 @@ import {
|
||||
import { useLocalSearchParams, useRouter } from "expo-router";
|
||||
import Stack from "expo-router/stack";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { Alert, Linking } from "react-native";
|
||||
import { Alert } from "react-native";
|
||||
import { buildThreadFilesNavigation, buildThreadReviewRoutePath } from "../../lib/routes";
|
||||
import { tryOpenExternalUrl } from "../../lib/openExternalUrl";
|
||||
import {
|
||||
basename,
|
||||
getTerminalStatusLabel,
|
||||
@@ -125,13 +126,8 @@ export function ThreadGitControls(props: {
|
||||
Alert.alert("No open PR", "This branch does not have an open pull request.");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await Linking.openURL(prUrl);
|
||||
} catch (error) {
|
||||
Alert.alert(
|
||||
"Unable to open PR",
|
||||
error instanceof Error ? error.message : "An error occurred.",
|
||||
);
|
||||
if (!(await tryOpenExternalUrl(prUrl, "pull-request"))) {
|
||||
Alert.alert("Unable to open PR", "The pull request could not be opened.");
|
||||
}
|
||||
}, [gitStatus]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user