Skip to content

Commit

Permalink
Restore response pool export feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaddeus McCleary committed Mar 24, 2021
1 parent 5ea623a commit fd0deec
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/views/SessionExplorer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,11 @@ export default {
},
startExport() {
this.exporting = true
let responses = this.filteredResponses
let responseString = ''
for (let i=0; i<this.session.responses.length; i++) {
let text = this.session.responses[i].response.text.split('\n').join()
for (let i=0; i<responses.length; i++) {
let text = responses[i].response.text.split('\n').join()
responseString += `${text.trimEnd()} \n`
}
Expand All @@ -524,12 +525,10 @@ export default {
this.exportMessage = `${defaultFilename} is ready for export.`
dialog.showSaveDialog(options, (filename) => {
this.fileSavePath = filename
dialog.showSaveDialog(options).then(result => {
// handle cancelation
if (filename !== undefined) {
fs.writeFileSync(filename, responseString, 'utf-8', this.resetExport())
if (result.filePath !== undefined) {
fs.writeFileSync(result.filePath, responseString, 'utf-8', this.resetExport())
} else {
this.resetExport()
}
Expand Down

0 comments on commit fd0deec

Please sign in to comment.