From 6fb99046b0dbe889ffd7f71ebeb381b76cb8eea1 Mon Sep 17 00:00:00 2001 From: Nick Rimmer Date: Sun, 16 Jul 2023 00:35:51 +0200 Subject: [PATCH] quick grpc fix --- src/ui/tabs-panel/tabs-panel.hook.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/ui/tabs-panel/tabs-panel.hook.ts b/src/ui/tabs-panel/tabs-panel.hook.ts index 367847a..f782f08 100644 --- a/src/ui/tabs-panel/tabs-panel.hook.ts +++ b/src/ui/tabs-panel/tabs-panel.hook.ts @@ -12,18 +12,7 @@ import React from 'react' export const useTabsPanel = (id: string)/*: UseTabsPanelData*/ => { const tabDataRef = useRef([]) - const [tabs, setTabs] = useState([ - // { title: 'Request 0', requestId: 'req_0', isActive: true }, - // { title: 'Request 1', requestId: 'req_1', isActive: false }, - // { title: 'Request 2', requestId: 'req_2', isActive: false }, - // { title: 'Request 3', requestId: 'req_3', isActive: false }, - // { title: 'Request 4', requestId: 'req_4', isActive: false }, - // { title: 'Request 5', requestId: 'req_5', isActive: false }, - // { title: 'Request 6', requestId: 'req_6', isActive: false }, - // { title: 'Request 7', requestId: 'req_7', isActive: false }, - // { title: 'Request 8', requestId: 'req_8', isActive: false }, - // { title: 'Request 9', requestId: 'req_9', isActive: false }, - ]) + const [tabs, setTabs] = useState([]) const [screenSize, setScreenSize] = React.useState(0) const [collapsedTabs, setCollapsedTabs] = React.useState([]) @@ -55,7 +44,10 @@ export const useTabsPanel = (id: string)/*: UseTabsPanelData*/ => { const requestInfo = getAllRequests()[requestId] let method = (requestInfo as any).method - if (!method && requestInfo._id.startsWith('greq_')) method = 'gRPC' + if (!method) { + if (requestInfo.type === 'GrpcRequest') method = 'gRPC' + else method = 'N/A' + } const tabData = { isActive: true, requestId, title: requestInfo.name, method } tabDataRef.current.forEach((x) => x.isActive = false)