Skip to content

Commit

Permalink
Refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigIskander committed Jul 1, 2024
1 parent 23b1ef3 commit 9661399
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/components/Sidebar/HistoryDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ interface Props {

function dowloadHistoryAsFile(props: Props) {
var filename = "save.txt"
var text = ''
const elementsText = props.items.map((element, index) => (
text.concat('"').concat(element.key).concat('";"').concat(element.value).concat('";\r\n')
const elementsText = props.items.map((element) => (
'"' + element.key + '";"' + element.value + '";\r\n'
))
var element = document.createElement('a')
element.setAttribute('href', 'data:text/csv;charset=utf-8,' + encodeURIComponent(elementsText.join('')))
Expand Down

0 comments on commit 9661399

Please sign in to comment.