fix(mobile): fix file sharing deep-link conflicts and add MIME type inference

- Skip known deep-link paths (qr-login, callback) in makeUrlHandler
  to prevent docuelevate://qr-login URLs from being treated as shared
  files and creating phantom upload errors
- Infer MIME type from file extension for files shared via iOS Share
  Sheet / "Open In…" so the server receives correct Content-Type
  instead of application/octet-stream
- Default login screen server URL to https://app.docuelevate.org

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-19 11:55:45 +00:00
parent 136631762b
commit 1559686f90
4 changed files with 104 additions and 21 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ import { useAuth } from "../context/AuthContext";
export default function LoginScreen() {
const { signIn, signInWithQR } = useAuth();
const router = useRouter();
const [serverUrl, setServerUrl] = useState("");
const [serverUrl, setServerUrl] = useState("https://app.docuelevate.org");
const [loading, setLoading] = useState(false);
const [qrLoading, setQrLoading] = useState(false);
+7 -16
View File
@@ -16,9 +16,12 @@ import {
} from "react-native";
import { useAuth } from "../context/AuthContext";
const DEFAULT_SERVER_URL = "https://app.docuelevate.org";
export default function ProfileScreen() {
const { user, signOut, baseUrl } = useAuth();
const effectiveBaseUrl = baseUrl || DEFAULT_SERVER_URL;
const appVersion = Constants.expoConfig?.version ?? "1.0.0";
function handleSignOut() {
@@ -33,10 +36,6 @@ 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.",
@@ -46,7 +45,7 @@ export default function ProfileScreen() {
text: "Delete Account",
style: "destructive",
onPress: () => {
Linking.openURL(`${baseUrl}/account/delete`);
Linking.openURL(`${effectiveBaseUrl}/account/delete`);
},
},
]
@@ -54,19 +53,11 @@ export default function ProfileScreen() {
}
function openPrivacyPolicy() {
if (!baseUrl) {
Alert.alert("Not Connected", "Cannot reach server. Please sign in again.");
return;
}
Linking.openURL(`${baseUrl}/privacy`);
Linking.openURL(`${effectiveBaseUrl}/privacy`);
}
function openTermsOfService() {
if (!baseUrl) {
Alert.alert("Not Connected", "Cannot reach server. Please sign in again.");
return;
}
Linking.openURL(`${baseUrl}/terms`);
Linking.openURL(`${effectiveBaseUrl}/terms`);
}
if (!user) {
@@ -105,7 +96,7 @@ export default function ProfileScreen() {
<View style={styles.row}>
<Text style={styles.rowLabel}>Server</Text>
<Text style={styles.rowValue} numberOfLines={1}>
{baseUrl || ""}
{effectiveBaseUrl}
</Text>
</View>
<View style={styles.row}>