refactor(mobile): extract shared MIME type utility and improve error handling

- Extract EXT_TO_MIME map and mimeTypeFromFilename to shared module
  at mobile/src/utils/mimeTypes.ts (used by _layout.tsx and +not-found.tsx)
- Add error logging to ensureLocalUri catch block for debugging
- Add error handling to Linking.openURL calls in ProfileScreen
- Fix incorrect LSSupportsOpeningDocumentsInPlace docs in audit report

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-19 12:05:47 +00:00
parent f549505bfd
commit cfe83d7efa
6 changed files with 59 additions and 81 deletions
+9 -3
View File
@@ -45,7 +45,9 @@ export default function ProfileScreen() {
text: "Delete Account",
style: "destructive",
onPress: () => {
Linking.openURL(`${effectiveBaseUrl}/account/delete`);
Linking.openURL(`${effectiveBaseUrl}/account/delete`).catch(() => {
Alert.alert("Error", "Could not open the account deletion page. Please try again.");
});
},
},
]
@@ -53,11 +55,15 @@ export default function ProfileScreen() {
}
function openPrivacyPolicy() {
Linking.openURL(`${effectiveBaseUrl}/privacy`);
Linking.openURL(`${effectiveBaseUrl}/privacy`).catch(() => {
Alert.alert("Error", "Could not open the privacy policy. Please try again.");
});
}
function openTermsOfService() {
Linking.openURL(`${effectiveBaseUrl}/terms`);
Linking.openURL(`${effectiveBaseUrl}/terms`).catch(() => {
Alert.alert("Error", "Could not open the terms of service. Please try again.");
});
}
if (!user) {