Add exportAsFile optional type argument

feature/default_network_editable
Whymarrh Whitby 6 years ago
parent 247fa2cc51
commit b83a746e4f
  1. 4
      ui/app/util.js

@ -271,9 +271,9 @@ function getContractAtAddress (tokenAddress) {
return global.eth.contract(abi).at(tokenAddress) return global.eth.contract(abi).at(tokenAddress)
} }
function exportAsFile (filename, data) { function exportAsFile (filename, data, type = 'text/csv') {
// source: https://stackoverflow.com/a/33542499 by Ludovic Feltz // source: https://stackoverflow.com/a/33542499 by Ludovic Feltz
const blob = new Blob([data], {type: 'text/csv'}) const blob = new Blob([data], {type})
if (window.navigator.msSaveOrOpenBlob) { if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveBlob(blob, filename) window.navigator.msSaveBlob(blob, filename)
} else { } else {

Loading…
Cancel
Save