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
+13 -7
View File
@@ -33,6 +33,10 @@ export default function ProfileScreen() {
}
function handleDeleteAccount() {
if (!baseUrl) {
Alert.alert("Not Connected", "Cannot reach server. Please sign in again.");
return;
}
Alert.alert(
"Delete Account",
"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",
style: "destructive",
onPress: () => {
if (baseUrl) {
Linking.openURL(`${baseUrl}/account/delete`);
}
Linking.openURL(`${baseUrl}/account/delete`);
},
},
]
@@ -52,15 +54,19 @@ export default function ProfileScreen() {
}
function openPrivacyPolicy() {
if (baseUrl) {
Linking.openURL(`${baseUrl}/privacy`);
if (!baseUrl) {
Alert.alert("Not Connected", "Cannot reach server. Please sign in again.");
return;
}
Linking.openURL(`${baseUrl}/privacy`);
}
function openTermsOfService() {
if (baseUrl) {
Linking.openURL(`${baseUrl}/terms`);
if (!baseUrl) {
Alert.alert("Not Connected", "Cannot reach server. Please sign in again.");
return;
}
Linking.openURL(`${baseUrl}/terms`);
}
if (!user) {