diff --git a/src/views/IdeaDetailView.vue b/src/views/IdeaDetailView.vue index 4d03738..383a28b 100644 --- a/src/views/IdeaDetailView.vue +++ b/src/views/IdeaDetailView.vue @@ -662,17 +662,29 @@ const downloadSelected = async () => { const projectId = localStorage.getItem('active_project_id') if (projectId) headers['X-Project-ID'] = projectId + // Fetch all blobs + const files = [] for (const assetId of ids) { const url = API_URL + '/assets/' + assetId const resp = await fetch(url, { headers }) const blob = await resp.blob() - const a = document.createElement('a') - a.href = URL.createObjectURL(blob) - a.download = assetId + '.png' - document.body.appendChild(a) - a.click() - document.body.removeChild(a) - URL.revokeObjectURL(a.href) + files.push(new File([blob], assetId + '.png', { type: blob.type || 'image/png' })) + } + + // Try native share (iOS share sheet) + if (navigator.canShare && navigator.canShare({ files })) { + await navigator.share({ files }) + } else { + // Fallback: browser download + for (const file of files) { + const a = document.createElement('a') + a.href = URL.createObjectURL(file) + a.download = file.name + document.body.appendChild(a) + a.click() + document.body.removeChild(a) + URL.revokeObjectURL(a.href) + } } toast.add({ severity: 'success', summary: 'Downloaded', detail: `${ids.length} image(s) saved`, life: 2000 }) } catch (e) {