From 071963ec5a79f1552579fdaf474be088c93255a0 Mon Sep 17 00:00:00 2001 From: vitorsemeano Date: Sat, 16 Mar 2019 21:48:44 +0000 Subject: [PATCH] added nativeshell API to filedownloader module --- src/components/filedownloader.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/filedownloader.js b/src/components/filedownloader.js index c8e3011be2..c5810b460e 100644 --- a/src/components/filedownloader.js +++ b/src/components/filedownloader.js @@ -4,9 +4,15 @@ define(['multi-download'], function (multiDownload) { return { download: function (items) { - multiDownload(items.map(function (item) { - return item.url; - })); + if (window.NativeShell) { + items.map(function (item) { + window.NativeShell.downloadFile(item.url); + }); + } else { + multiDownload(items.map(function (item) { + return item.url; + })); + } } }; }); \ No newline at end of file