Skip to content

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

Bug : not adding to history and a failed request, fixed.

izerozlua3f8abba1a87
diff --git a/components/history.vue b/components/history.vue
index 999d4a453..ab802bebb 100644
--- a/components/history.vue
+++ b/components/history.vue
@@ -74,6 +74,7 @@
},
addEntry(entry) {
this.history.push(entry);
+ updateOnLocalStorage('history', this.history);
}
}
}
diff --git a/pages/index.vue b/pages/index.vue
index f7537fd4f..a17885dfe 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -416,7 +416,18 @@
this.response.headers = error.response.headers;
this.response.status = error.response.status;
this.response.body = error.response.data;
- return;
+
+ // Addition of an entry to the history component.
+ const entry = {
+ status: this.response.status,
+ date: new Date().toLocaleDateString(),
+ time: new Date().toLocaleTimeString(),
+ method: this.method,
+ url: this.url,
+ path: this.path
+ };
+ this.$refs.historyComponent.addEntry(entry);
+ return;
}
this.response.status = error.message;