Skip to content

Commit f22f8bc

Browse files
committed
Fixed requests list behavior with "preserve log" disabled.
1 parent 9bb08ae commit f22f8bc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/RequestsList.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,22 @@ export default {
9999
this.$requests.loadPrevious(10).then(() => {
100100
this.loadingMoreRequests = false
101101
})
102+
},
103+
shouldShowFirstRequest() {
104+
return ! this.$store.get('preserveLog')
105+
&& (! this.$request || ! this.$requests.findId(this.$request.id))
106+
},
107+
shouldShowIncomingRequest() {
108+
return this.$store.get('preserveLog')
109+
&& (! this.$request || this.global.showIncomingRequests)
102110
}
103111
},
104112
watch: {
105113
requests: {
106114
handler(items) {
107-
if (! this.$store.get('preserveLog')) {
115+
if (this.shouldShowFirstRequest()) {
108116
this.showRequest(this.global.$requests.first())
109-
} else if (this.global.showIncomingRequests) {
117+
} else if (this.shouldShowIncomingRequest()) {
110118
this.showRequest(this.global.$requests.last())
111119
this.$refs.requestsContainer.scrollTop = this.$refs.requestsTable.offsetHeight
112120
}

0 commit comments

Comments
 (0)