Skip to content

Commit

Permalink
Fixed requests list behavior with "preserve log" disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
itsgoingd committed Oct 30, 2019
1 parent 9bb08ae commit f22f8bc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/RequestsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,22 @@ export default {
this.$requests.loadPrevious(10).then(() => {
this.loadingMoreRequests = false
})
},
shouldShowFirstRequest() {
return ! this.$store.get('preserveLog')
&& (! this.$request || ! this.$requests.findId(this.$request.id))
},
shouldShowIncomingRequest() {
return this.$store.get('preserveLog')
&& (! this.$request || this.global.showIncomingRequests)
}
},
watch: {
requests: {
handler(items) {
if (! this.$store.get('preserveLog')) {
if (this.shouldShowFirstRequest()) {
this.showRequest(this.global.$requests.first())
} else if (this.global.showIncomingRequests) {
} else if (this.shouldShowIncomingRequest()) {
this.showRequest(this.global.$requests.last())
this.$refs.requestsContainer.scrollTop = this.$refs.requestsTable.offsetHeight
}
Expand Down

0 comments on commit f22f8bc

Please sign in to comment.