Skip to content

Commit

Permalink
fix(ui) if you keep response panel tab as request and send a request …
Browse files Browse the repository at this point in the history
…that will error out, the request will get stuck in the loading state and cannot be cancelled
  • Loading branch information
flawiddsouza committed May 16, 2024
1 parent 350b857 commit 889c9d7
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions packages/ui/src/components/ResponsePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,12 @@ export default {
tabs.push(tab)
}
tabs.push({
name: 'Timeline',
label: 'Timeline'
})
if(this.response && 'request' in this.response) {
tabs.push({
name: 'Timeline',
label: 'Timeline'
})
}
return tabs
},
Expand Down Expand Up @@ -383,9 +385,14 @@ export default {
},
watch: {
response() {
if(this.responsePanelTabs.length === 2 && this.activeResponsePanelTab === 'Request') {
if(this.responsePanelTabs.length === 2 && (this.activeResponsePanelTab === 'Request' || this.activeResponsePanelTab === 'Tests' || this.activeResponsePanelTab === 'Timeline')) {
this.activeResponsePanelTab = 'Preview'
}
if(this.response && this.response.statusText === 'Error') {
this.activeResponsePanelTab = 'Preview'
}
this.responseFilter = ''
this.isXmlResponse = this.responseContentType.startsWith(constants.MIME_TYPE.XML) ? true : false
}
Expand Down

0 comments on commit 889c9d7

Please sign in to comment.