From: Ardis Lu Date: Sat, 18 Dec 2021 07:54:21 +0000 (-0800) Subject: Simplify download link generation X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=9b4fc6d1a8e6a133b1f3e5208febe125d02e0983;p=sheets-db Simplify download link generation --- diff --git a/query-to-db.html b/query-to-db.html index 1942d33..78f77c7 100644 --- a/query-to-db.html +++ b/query-to-db.html @@ -112,8 +112,8 @@ const buffer = db.export(); file = new File([buffer], 'database.sqlite3', { type: 'application/vnd.sqlite3' }); - downloadLink.setAttribute('download', `${Date.now()}.sqlite3`); - downloadLink.setAttribute('href', `${URL.createObjectURL(file)}`); + downloadLink.href = URL.createObjectURL(file); + downloadLink.download = `${Date.now()}.sqlite3`; setState('downloadReady'); }).generateDatabaseQuery(); });