Merge pull request #1742 from s-r-x/fix/nil-response-time

fix: undefined duration
This commit is contained in:
Liyas Thomas
2021-07-14 12:51:09 +05:30
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -110,8 +110,7 @@
:aria-label="$t('duration')" :aria-label="$t('duration')"
type="text" type="text"
readonly readonly
:value="`Duration: ${entry.duration}ms`" :value="duration"
:placeholder="$t('no_duration')"
class="input pt-0 mt-0 text-sm bg-transparent text-secondaryLight" class="input pt-0 mt-0 text-sm bg-transparent text-secondaryLight"
/> />
</li> </li>
@@ -144,6 +143,12 @@ export default {
} }
}, },
computed: { computed: {
duration() {
const { duration } = this.entry
return duration > 0
? `${this.$t("duration")}: ${duration}ms`
: this.$t("no_duration")
},
entryStatus() { entryStatus() {
const foundStatusGroup = findStatusGroup(this.entry.status) const foundStatusGroup = findStatusGroup(this.entry.status)
return ( return (

View File

@@ -1568,6 +1568,7 @@ export default {
path: this.path, path: this.path,
usesPreScripts: this.showPreRequestScript, usesPreScripts: this.showPreRequestScript,
preRequestScript: this.preRequestScript, preRequestScript: this.preRequestScript,
duration,
star: false, star: false,
auth: this.auth, auth: this.auth,
httpUser: this.httpUser, httpUser: this.httpUser,