From 79bf0d03639fbb94ca97195c696531b4930bff4e Mon Sep 17 00:00:00 2001 From: Akash K <57758277+amk-dev@users.noreply.github.com> Date: Thu, 10 Oct 2024 18:11:58 +0530 Subject: [PATCH] fix: add full request as request context (#4422) Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com> --- packages/hoppscotch-common/src/pages/index.vue | 5 ++++- .../src/services/spotlight/searchers/request.searcher.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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) => { 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