Skip to content

Commit

Permalink
fix: undefined duration
Browse files Browse the repository at this point in the history
  • Loading branch information
s-r-x committed Jul 14, 2021
1 parent bfd9327 commit 2907d69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/history/rest/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@
:aria-label="$t('duration')"
type="text"
readonly
:value="`Duration: ${entry.duration}ms`"
:placeholder="$t('no_duration')"
:value="duration"
class="input pt-0 mt-0 text-sm bg-transparent text-secondaryLight"
/>
</li>
Expand Down Expand Up @@ -144,6 +143,12 @@ export default {
}
},
computed: {
duration() {
const { duration } = this.entry
return duration > 0
? `${this.$t("duration")}: ${duration}ms`
: this.$t("no_duration")
},
entryStatus() {
const foundStatusGroup = findStatusGroup(this.entry.status)
return (
Expand Down
1 change: 1 addition & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@ export default {
path: this.path,
usesPreScripts: this.showPreRequestScript,
preRequestScript: this.preRequestScript,
duration,
star: false,
auth: this.auth,
httpUser: this.httpUser,
Expand Down

0 comments on commit 2907d69

Please sign in to comment.