From 04acb886b04a65e47382fbcfd31890bfddfcbc68 Mon Sep 17 00:00:00 2001 From: Koki Takahashi Date: Sat, 15 Sep 2018 01:40:17 +0900 Subject: [PATCH] Implment export dialog and dump feature (resolves #13, ref #5) --- lib/db.js | 4 +-- pages/solves/index.vue | 59 +++++++++++++++++++++++++++++++----------- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/lib/db.js b/lib/db.js index 530096dc..7d65a90f 100644 --- a/lib/db.js +++ b/lib/db.js @@ -353,8 +353,8 @@ export const exportTimes = async () => { saveAs(blob, `smart-cube-timer-export-${formatSerializedDate(Date.now())}.txt`); }; -export const exportAll = async () => { +export const dump = async () => { const solves = await db.solves.where('date').above(new Date('2018-08-09 00:00:00+0900').getTime()).reverse().sortBy('date'); - const blob = new Blob([JSON.stringify(solves, null, ' ')], {type: 'text/plain;charset=utf-8'}); + const blob = new Blob([JSON.stringify(solves)], {type: 'text/plain;charset=utf-8'}); saveAs(blob, `smart-cube-timer-dump-${formatSerializedDate(Date.now())}.json`); }; diff --git a/pages/solves/index.vue b/pages/solves/index.vue index faa7ff0f..1890dd96 100644 --- a/pages/solves/index.vue +++ b/pages/solves/index.vue @@ -1,11 +1,6 @@