Skip to content

Commit

Permalink
Add timestamp to exported settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
killergerbah committed Oct 16, 2024
1 parent c890b04 commit 0b29719
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion common/components/SettingsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,14 @@ export default function SettingsForm({
settingsFileInputRef.current?.click();
}, []);
const handleExportSettings = useCallback(() => {
download(new Blob([JSON.stringify(settings)], { type: 'appliction/json' }), 'asbplayer-settings.json');
const now = new Date();
const timeString = `${now.getFullYear()}-${
now.getMonth() + 1
}-${now.getDate()}-${now.getHours()}-${now.getMinutes()}-${now.getSeconds()}`;
download(
new Blob([JSON.stringify(settings)], { type: 'appliction/json' }),
`asbplayer-settings-${timeString}.json`
);
}, [settings]);

const handleAnkiFieldOrderChange = useCallback(
Expand Down

0 comments on commit 0b29719

Please sign in to comment.