Skip to content

Commit

Permalink
Include current time in export file name
Browse files Browse the repository at this point in the history
  • Loading branch information
qsantos committed Jan 27, 2025
1 parent cc9eb09 commit 6a79393
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,8 @@ async function exportData() {
return;
}

const now = new Date();

// show spinner
const button = getElement("export-button", HTMLButtonElement);
button.classList.add("spinning");
Expand All @@ -1746,7 +1748,7 @@ async function exportData() {
const data = JSON.stringify({ sessions, characters, settings });
const blob = new Blob([data]);
const compressed = await compressBlob(blob);
saveFile(compressed, "morse-cat-data.json.gz");
saveFile(compressed, `morse-cat-data-${now.toISOString()}.json.gz`);

// hide spinner
button.classList.remove("spinning");
Expand Down

0 comments on commit 6a79393

Please sign in to comment.