From 80139d9a823a6db5e79c0ff5f0e885c4812850ae Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 9 Jun 2026 03:11:35 +0200 Subject: [PATCH] Prevent mobile image download preview fallback --- mobile/android/app/build.gradle | 4 ++-- mobile/package-lock.json | 4 ++-- mobile/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- public/js/assistant/images.js | 14 +++++++++----- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle index e45fff2..1fd6196 100644 --- a/mobile/android/app/build.gradle +++ b/mobile/android/app/build.gradle @@ -9,8 +9,8 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion // Version values below are overwritten by scripts/release.sh from // the root package.json. versionCode auto-increments per release. - versionCode 714011 - versionName "7.14.11" + versionCode 714012 + versionName "7.14.12" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/mobile/package-lock.json b/mobile/package-lock.json index 8cc2394..69e1614 100644 --- a/mobile/package-lock.json +++ b/mobile/package-lock.json @@ -1,12 +1,12 @@ { "name": "pedscribe-mobile", - "version": "7.14.11", + "version": "7.14.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pedscribe-mobile", - "version": "7.14.11", + "version": "7.14.12", "dependencies": { "@aparajita/capacitor-biometric-auth": "^8.0.0", "@capacitor/android": "^6.0.0", diff --git a/mobile/package.json b/mobile/package.json index 980b567..841898b 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -1,6 +1,6 @@ { "name": "pedscribe-mobile", - "version": "7.14.11", + "version": "7.14.12", "description": "PedScribe native mobile app — Capacitor wrapper for Pediatric AI Scribe", "private": true, "scripts": { diff --git a/package-lock.json b/package-lock.json index f980c65..ca07615 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pediatric-ai-scribe", - "version": "7.14.11", + "version": "7.14.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pediatric-ai-scribe", - "version": "7.14.11", + "version": "7.14.12", "dependencies": { "@marp-team/marp-cli": "^4.3.1", "@marp-team/marp-core": "^4.3.0", diff --git a/package.json b/package.json index b1848da..e015bf0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pediatric-ai-scribe", - "version": "7.14.11", + "version": "7.14.12", "description": "AI-powered pediatric clinical documentation platform", "main": "server.js", "scripts": { diff --git a/public/js/assistant/images.js b/public/js/assistant/images.js index 612ddfe..417b910 100644 --- a/public/js/assistant/images.js +++ b/public/js/assistant/images.js @@ -49,6 +49,10 @@ export function createAssistantImageStore() { if (typeof window.showToast === 'function') window.showToast('Image saving is not available in this app build yet. Update the app and try again.', 'error'); return; } + if (isMobileBrowser()) { + if (typeof window.showToast === 'function') window.showToast('Mobile browser download is not supported here. Use Preview and long-press the image to save it.', 'info'); + return; + } await downloadWithBrowser(src); } catch (e) { if (typeof window.showToast === 'function') window.showToast(e.message || 'Image download failed', 'error'); @@ -123,7 +127,7 @@ async function saveWithCapacitorShare(src) { if (typeof window.showToast === 'function') window.showToast('Image prepared', 'success'); return true; } catch (e) { - if (typeof window.showToast === 'function') window.showToast('Could not save with the app. Opening browser download instead.', 'error'); + if (typeof window.showToast === 'function') window.showToast('Could not save with the app. Use Preview and long-press the image to save it.', 'error'); return false; } } @@ -140,6 +144,10 @@ async function shareWithWebFile(src) { } async function downloadWithBrowser(src) { + if (isMobileBrowser()) { + if (typeof window.showToast === 'function') window.showToast('Mobile browser download is not supported here. Use Preview and long-press the image to save it.', 'info'); + return; + } var blob = await imageSourceToBlob(src); var objectUrl = URL.createObjectURL(blob); var a = document.createElement('a'); @@ -150,10 +158,6 @@ async function downloadWithBrowser(src) { a.click(); a.remove(); setTimeout(function() { URL.revokeObjectURL(objectUrl); }, 60000); - - if (isMobileBrowser() && typeof window.showToast === 'function') { - window.showToast('If the download did not start, use Preview and long-press the image to save it.', 'info'); - } } function isMobileBrowser() {