Skip to content

Commit

Permalink
fix: fixed export when no categories saved, and added pretty printing…
Browse files Browse the repository at this point in the history
… to exports
  • Loading branch information
ErikBjare committed Jun 21, 2021
1 parent 0eae7ae commit d40b948
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/views/settings/CategorizationSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ export default {
exportClasses: function () {
console.log('Exporting categories...');
if (localStorage.classes === undefined) {
alert('No classes saved, nothing to export!');
}
const export_data = {
categories: JSON.parse(localStorage.classes),
};
const text = JSON.stringify(export_data);
// Pretty-format it for easier reading
const text = JSON.stringify(export_data, null, 2);
const filename = 'aw-category-export.json';
// Initiate downloading a file by creating a hidden button and clicking it
Expand Down

1 comment on commit d40b948

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are screenshots of this commit:

Screenshots using aw-server v0.10.0 (click to expand)

Screenshots using aw-server-rust master (click to expand)

Screenshots using aw-server-rust v0.10.0 (click to expand)

CML watermark

Please sign in to comment.