Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: undefined duration

s-r-x2907d69dfc17
diff --git a/components/history/rest/Card.vue b/components/history/rest/Card.vue
index 150731f15..acda193c3 100644
--- a/components/history/rest/Card.vue
+++ b/components/history/rest/Card.vue
@@ -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>
@@ -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 (
diff --git a/pages/index.vue b/pages/index.vue
index 4512ab560..14528a381 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -1568,6 +1568,7 @@ export default {
path: this.path,
usesPreScripts: this.showPreRequestScript,
preRequestScript: this.preRequestScript,
+ duration,
star: false,
auth: this.auth,
httpUser: this.httpUser,