fix(mobile): add user feedback when server URL is unavailable

Show alert dialogs when Privacy Policy, Terms of Service, or
account deletion links cannot be opened due to missing server URL.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-19 11:46:54 +00:00
parent 1572f322d7
commit 136631762b
+12 -6
View File
@@ -33,6 +33,10 @@ export default function ProfileScreen() {
} }
function handleDeleteAccount() { function handleDeleteAccount() {
if (!baseUrl) {
Alert.alert("Not Connected", "Cannot reach server. Please sign in again.");
return;
}
Alert.alert( Alert.alert(
"Delete Account", "Delete Account",
"This will permanently delete your account and all associated data. This action cannot be undone.", "This will permanently delete your account and all associated data. This action cannot be undone.",
@@ -42,9 +46,7 @@ export default function ProfileScreen() {
text: "Delete Account", text: "Delete Account",
style: "destructive", style: "destructive",
onPress: () => { onPress: () => {
if (baseUrl) {
Linking.openURL(`${baseUrl}/account/delete`); Linking.openURL(`${baseUrl}/account/delete`);
}
}, },
}, },
] ]
@@ -52,15 +54,19 @@ export default function ProfileScreen() {
} }
function openPrivacyPolicy() { function openPrivacyPolicy() {
if (baseUrl) { if (!baseUrl) {
Linking.openURL(`${baseUrl}/privacy`); Alert.alert("Not Connected", "Cannot reach server. Please sign in again.");
return;
} }
Linking.openURL(`${baseUrl}/privacy`);
} }
function openTermsOfService() { function openTermsOfService() {
if (baseUrl) { if (!baseUrl) {
Linking.openURL(`${baseUrl}/terms`); Alert.alert("Not Connected", "Cannot reach server. Please sign in again.");
return;
} }
Linking.openURL(`${baseUrl}/terms`);
} }
if (!user) { if (!user) {