From 9b4fc6d1a8e6a133b1f3e5208febe125d02e0983 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Fri, 17 Dec 2021 23:54:21 -0800 Subject: [PATCH] Simplify download link generation --- query-to-db.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); }); -- 2.47.3