diff --git a/packages/hoppscotch-common/src/components/history/index.vue b/packages/hoppscotch-common/src/components/history/index.vue index f29d4d3ef..91c12b968 100644 --- a/packages/hoppscotch-common/src/components/history/index.vue +++ b/packages/hoppscotch-common/src/components/history/index.vue @@ -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 +}) diff --git a/packages/hoppscotch-common/src/helpers/actions.ts b/packages/hoppscotch-common/src/helpers/actions.ts index f18c5d4da..33bae0668 100644 --- a/packages/hoppscotch-common/src/helpers/actions.ts +++ b/packages/hoppscotch-common/src/helpers/actions.ts @@ -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