feat: add clear history action

This commit is contained in:
Andrew Bastin
2023-07-03 11:23:02 +05:30
parent 9dbce74f5e
commit be61b62825
2 changed files with 6 additions and 0 deletions

View File

@@ -176,6 +176,7 @@ import {
import HistoryRestCard from "./rest/Card.vue"
import HistoryGraphqlCard from "./graphql/Card.vue"
import { createNewTab } from "~/helpers/rest/tab"
import { defineActionHandler } from "~/helpers/actions"
type HistoryEntry = GQLHistoryEntry | RESTHistoryEntry
@@ -329,4 +330,8 @@ const toggleStar = (entry: HistoryEntry) => {
toggleRESTHistoryEntryStar(entry as RESTHistoryEntry)
else toggleGraphqlHistoryEntryStar(entry as GQLHistoryEntry)
}
defineActionHandler("history.clear", () => {
confirmRemove.value = true
})
</script>

View File

@@ -38,6 +38,7 @@ export type HoppAction =
| "response.file.download" // Download response as file
| "response.copy" // Copy response to clipboard
| "modals.login.toggle" // Login to Hoppscotch
| "history.clear" // Clear REST History
/**
* Defines the arguments, if present for a given type that is required to be passed on