Remove dependency on history component to add history entry

This commit is contained in:
Andrew Bastin
2021-05-24 22:39:58 -04:00
parent 46ebd49936
commit 9e602394cf
3 changed files with 5 additions and 12 deletions

View File

@@ -98,8 +98,6 @@ import {
clearGraphqlHistory,
toggleGraphqlHistoryEntryStar,
toggleRESTHistoryEntryStar,
addGraphqlHistoryEntry,
addRESTHistoryEntry,
deleteGraphqlHistoryEntry,
deleteRESTHistoryEntry
} from "~/newstore/history"
@@ -155,10 +153,6 @@ export default {
icon: "delete",
})
},
addEntry(entry) {
if (this.page === "rest") addRESTHistoryEntry(entry)
else addGraphqlHistoryEntry(entry)
},
enableHistoryClearing() {
if (!this.history || !this.history.length) return
this.isClearingHistory = true

View File

@@ -481,6 +481,7 @@ import { commonHeaders } from "~/helpers/headers"
import { getPlatformSpecialKey } from "~/helpers/platformutils"
import { sendNetworkRequest } from "~/helpers/network"
import { getSettingSubject } from "~/newstore/settings"
import { addGraphqlHistoryEntry } from "~/newstore/history"
export default {
beforeRouteLeave(_to, _from, next) {
@@ -852,8 +853,7 @@ export default {
duration,
}
// TODO: Use history store system mechanism instead!
this.$refs.graphqlHistoryComponent.addEntry(entry)
addGraphqlHistoryEntry(entry)
} catch (error) {
this.response = `${error}. ${this.$t("check_console_details")}`
this.$nuxt.$loading.finish()

View File

@@ -669,6 +669,7 @@ import { httpValid } from "~/helpers/utils/valid"
import { knownContentTypes, isJSONContentType } from "~/helpers/utils/contenttypes"
import { generateCodeWithGenerator } from "~/helpers/codegen/codegen"
import { getSettingSubject, applySetting } from "~/newstore/settings"
import { addRESTHistoryEntry } from "~/newstore/history"
import clone from "lodash/clone"
export default {
@@ -1409,8 +1410,7 @@ export default {
entry.url = parseTemplateString(entry.url, environmentVariables)
}
// TODO: Use the history store mechanism instead!
this.$refs.historyComponent.addEntry(entry)
addRESTHistoryEntry(entry)
})()
} catch (error) {
this.runningRequest = false
@@ -1465,8 +1465,7 @@ export default {
entry.url = parseTemplateString(entry.url, environmentVariables)
}
// TODO: Use the history state mechanism instead!
this.$refs.historyComponent.addEntry(entry)
addRESTHistoryEntry(entry)
return
} else {
this.response.status = error.message