diff --git a/frontend/js/main.js b/frontend/js/main.js index 15cb8e8..34a5328 100644 --- a/frontend/js/main.js +++ b/frontend/js/main.js @@ -1425,8 +1425,8 @@ async function renderRecipes(container) {

Рецепты

- - + +
@@ -3432,8 +3432,8 @@ async function renderSupplements(container) {

Добавки

- - + +
@@ -4280,8 +4280,18 @@ function addZoomDisplay(map) { // Export/Import: recipes, supplements // --------------------------------------------------------------------------- -function downloadFile(filename, content, mimeType) { - const blob = new Blob([content], { type: mimeType || "application/json" }); +async function downloadFile(filename, content) { + // Use Tauri save_file (works on Android via SAF) + try { + if (window.__TAURI__) { + await window.__TAURI__.core.invoke("save_file", { filename, content }); + return; + } + } catch (e) { + console.error("[download] Tauri save error:", e); + } + // Fallback for desktop browsers + const blob = new Blob([content], { type: "application/json" }); const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = filename;