Prevent mobile image download preview fallback
All checks were successful
Forgejo Android APK / Build signed APK (push) Successful in 1m58s
All checks were successful
Forgejo Android APK / Build signed APK (push) Successful in 1m58s
This commit is contained in:
parent
f7cfc6695d
commit
80139d9a82
6 changed files with 17 additions and 13 deletions
|
|
@ -9,8 +9,8 @@ android {
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
// Version values below are overwritten by scripts/release.sh from
|
// Version values below are overwritten by scripts/release.sh from
|
||||||
// the root package.json. versionCode auto-increments per release.
|
// the root package.json. versionCode auto-increments per release.
|
||||||
versionCode 714011
|
versionCode 714012
|
||||||
versionName "7.14.11"
|
versionName "7.14.12"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||||
|
|
|
||||||
4
mobile/package-lock.json
generated
4
mobile/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "pedscribe-mobile",
|
"name": "pedscribe-mobile",
|
||||||
"version": "7.14.11",
|
"version": "7.14.12",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pedscribe-mobile",
|
"name": "pedscribe-mobile",
|
||||||
"version": "7.14.11",
|
"version": "7.14.12",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aparajita/capacitor-biometric-auth": "^8.0.0",
|
"@aparajita/capacitor-biometric-auth": "^8.0.0",
|
||||||
"@capacitor/android": "^6.0.0",
|
"@capacitor/android": "^6.0.0",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "pedscribe-mobile",
|
"name": "pedscribe-mobile",
|
||||||
"version": "7.14.11",
|
"version": "7.14.12",
|
||||||
"description": "PedScribe native mobile app — Capacitor wrapper for Pediatric AI Scribe",
|
"description": "PedScribe native mobile app — Capacitor wrapper for Pediatric AI Scribe",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "pediatric-ai-scribe",
|
"name": "pediatric-ai-scribe",
|
||||||
"version": "7.14.11",
|
"version": "7.14.12",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pediatric-ai-scribe",
|
"name": "pediatric-ai-scribe",
|
||||||
"version": "7.14.11",
|
"version": "7.14.12",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@marp-team/marp-cli": "^4.3.1",
|
"@marp-team/marp-cli": "^4.3.1",
|
||||||
"@marp-team/marp-core": "^4.3.0",
|
"@marp-team/marp-core": "^4.3.0",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "pediatric-ai-scribe",
|
"name": "pediatric-ai-scribe",
|
||||||
"version": "7.14.11",
|
"version": "7.14.12",
|
||||||
"description": "AI-powered pediatric clinical documentation platform",
|
"description": "AI-powered pediatric clinical documentation platform",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -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');
|
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;
|
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);
|
await downloadWithBrowser(src);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (typeof window.showToast === 'function') window.showToast(e.message || 'Image download failed', 'error');
|
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');
|
if (typeof window.showToast === 'function') window.showToast('Image prepared', 'success');
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} 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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -140,6 +144,10 @@ async function shareWithWebFile(src) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function downloadWithBrowser(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 blob = await imageSourceToBlob(src);
|
||||||
var objectUrl = URL.createObjectURL(blob);
|
var objectUrl = URL.createObjectURL(blob);
|
||||||
var a = document.createElement('a');
|
var a = document.createElement('a');
|
||||||
|
|
@ -150,10 +158,6 @@ async function downloadWithBrowser(src) {
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
setTimeout(function() { URL.revokeObjectURL(objectUrl); }, 60000);
|
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() {
|
function isMobileBrowser() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue