Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After the giant refactor, both "email log" and "download JSON dump" were broken. We fixed "email log" in e-mission#1160 but didn't fix "Download JSON dump then, because of lack of time. This fixes the "Download JSON dump" as well by making it similar to implementation in "email log". It was already fairly similar, but for some reason, was reading the data before sharing the file ``` const reader = new FileReader(); reader.onloadend = () => { const readResult = this.result as string; logDebug(`Successfull file read with ${readResult.length} characters`); ``` and "this" doesn't exist, resulting in an undefined error. Since the shareObj takes in a file name anyway, I just made this similar to the emailLog changes by passing in the filename directly. Also, similar ot the "Email Log", added a `.txt` extension so that the file can be sent on iOS. Testing done: - Before this change: clicking on "Download JSON dump" did not do anything - After this change: clicking on "Download JSON dump" launched the share menu I haven't actually tried sharing yet because gmail is not configured on the emulator.
- Loading branch information