History is sorted from latest to oldest
This commit is contained in:
@@ -87,12 +87,15 @@ const app = new Vue({
|
|||||||
},
|
},
|
||||||
sendRequest() {
|
sendRequest() {
|
||||||
const n = new Date().toLocaleTimeString()
|
const n = new Date().toLocaleTimeString()
|
||||||
this.history.push({
|
|
||||||
|
// Latest requests should be placed on top
|
||||||
|
this.history = [{
|
||||||
time: n,
|
time: n,
|
||||||
method: this.method,
|
method: this.method,
|
||||||
url: this.url,
|
url: this.url,
|
||||||
path: this.path
|
path: this.path
|
||||||
})
|
}, ...this.history]
|
||||||
|
|
||||||
window.localStorage.setItem("history", JSON.stringify(this.history))
|
window.localStorage.setItem("history", JSON.stringify(this.history))
|
||||||
if (this.$refs.response.classList.contains('hidden')) {
|
if (this.$refs.response.classList.contains('hidden')) {
|
||||||
this.$refs.response.classList.toggle('hidden')
|
this.$refs.response.classList.toggle('hidden')
|
||||||
|
|||||||
Reference in New Issue
Block a user