Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
npbreland committed Nov 26, 2023
1 parent 02a621f commit a1e3d4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/habitbuilder/csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const CSV_HEADER = "date,question,response\n";
// Cleans the CSV data by removing duplicate entries
document.addEventListener('click', function (event) {
if (event.target.id === 'download-csv') {
Util.saveCSV("habitbuilder.data.csv");
Util.saveCSV("habitbuilder.data.csv", csvData);
return;
// String representation of the CSV post-cleaning
let cleanCsvStr = CSV_HEADER;

Check warning on line 9 in apps/habitbuilder/csv.js

View workflow job for this annotation

GitHub Actions / build

Unreachable code
Expand Down
9 changes: 9 additions & 0 deletions apps/habitbuilder/interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,17 @@ <h2>Settings</h2>
});
}

let csvData = '';

function getData() {
Util.readStorage('habitbuilder.data.csv', data => {
csvData = data.trim();
});
}

// Called when app starts
function onInit() {
getData();
getSettings();
}
</script>
Expand Down

0 comments on commit a1e3d4a

Please sign in to comment.