Skip to content

Commit

Permalink
fixed export function
Browse files Browse the repository at this point in the history
  • Loading branch information
evdokimovm committed Dec 2, 2023
1 parent dea9bb8 commit 5b8582e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,14 @@ function getFileContents(e, files, index) {
}

function exportFile(e, files, index) {
var file = index ? files[index] : files
var file = index >= 0 ? files[index] : files
var json = JSON.stringify(file)
var blob = new Blob([json], { type: 'application/json' })
var url = URL.createObjectURL(blob)

var link = document.createElement('a')
link.href = url
link.download = index ? files[index].name : 'alltabs.json'
link.download = index >= 0 ? files[index].name : 'alltabs.json'
link.click()

URL.revokeObjectURL(url)
Expand Down

0 comments on commit 5b8582e

Please sign in to comment.