refactor(mobile): address code review feedback

Extract APP_SCHEME_PREFIX constant for the custom URL scheme string,
and derive the photo library fallback filename extension from the
asset's MIME type instead of always using .jpg.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-16 17:26:28 +00:00
parent acfba4b58c
commit b6af39c567
2 changed files with 9 additions and 5 deletions
+3 -1
View File
@@ -180,7 +180,9 @@ export default function UploadScreen() {
if (!result.canceled && result.assets.length > 0) {
const asset = result.assets[0];
const filename = asset.fileName ?? `photo_${Date.now()}.jpg`;
// Derive extension from MIME type so the filename matches the actual format
const ext = asset.mimeType?.split("/")[1]?.replace("jpeg", "jpg") ?? "jpg";
const filename = asset.fileName ?? `photo_${Date.now()}.${ext}`;
await uploadFile(asset.uri, filename, asset.mimeType ?? "image/jpeg");
}
}