Skip to content

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

fix: add full request as request context (#4422)

Akash K79bf0d03639f
diff --git a/packages/hoppscotch-common/src/pages/index.vue b/packages/hoppscotch-common/src/pages/index.vue
index 895dd777b..8634d1fe3 100644
--- a/packages/hoppscotch-common/src/pages/index.vue
+++ b/packages/hoppscotch-common/src/pages/index.vue
@@ -278,7 +278,10 @@ const getTabName = (tab: HoppTab<HoppTabDocument>) => {
const requestToRename = computed(() => {
if (!renameTabID.value) return null
const tab = tabs.getTabRef(renameTabID.value)
- return getTabName(tab.value)
+
+ return tab.value.document.type === "request"
+ ? tab.value.document.request
+ : null
})
const openReqRenameModal = (tabID?: string) => {
diff --git a/packages/hoppscotch-common/src/services/spotlight/searchers/request.searcher.ts b/packages/hoppscotch-common/src/services/spotlight/searchers/request.searcher.ts
index f26293091..e066cff3a 100644
--- a/packages/hoppscotch-common/src/services/spotlight/searchers/request.searcher.ts
+++ b/packages/hoppscotch-common/src/services/spotlight/searchers/request.searcher.ts
@@ -47,7 +47,11 @@ export class RequestSpotlightSearcherService extends StaticSpotlightSearcherServ
private readonly restTab = this.bind(RESTTabService)
private route = useRoute()
- private isRESTPage = computed(() => this.route.name === "index")
+ private isRESTPage = computed(
+ () =>
+ this.route.name === "index" &&
+ this.restTab.currentActiveTab.value.document.type === "request"
+ )
private isGQLPage = computed(() => this.route.name === "graphql")
private isRESTOrGQLPage = computed(
() => this.isRESTPage.value || this.isGQLPage.value