Skip to content

Commit

Permalink
improve save file name
Browse files Browse the repository at this point in the history
include cmdr name and save locale time
  • Loading branch information
BarthPaleologue committed Nov 3, 2024
1 parent 8b419d7 commit ca26abe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ts/cosmosJourneyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ export class CosmosJourneyer {
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = "save.json";
const dateString = new Date().toLocaleString().replace(/[^0-9a-zA-Z]/g, "_"); // avoid special characters in the filename
link.download = `CMDR_${this.player.name}_${dateString}.json`;
link.click();
}

Expand Down

0 comments on commit ca26abe

Please sign in to comment.