]> git.ardis.lu - sheets-db/commitdiff
Simplify download link generation
authorArdis Lu <ardisglu@gmail.com>
Sat, 18 Dec 2021 07:54:21 +0000 (23:54 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sat, 18 Dec 2021 07:55:29 +0000 (23:55 -0800)
query-to-db.html

index 1942d33e9e6efe7ff0c560e3e354168096ec3857..78f77c7c9839db1a67565ac54b2028934d19c56a 100644 (file)
         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();
     });
This page took 0.046921 seconds and 4 git commands to generate.