mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-26 00:04:33 +00:00
Hide Response tab if there is no response (#1197)
This commit is contained in:
parent
de554f5fb6
commit
4b280ecd6d
@ -32,7 +32,7 @@ export const AutoRepresentation: React.FC<any> = ({ representation, color, opene
|
|||||||
badge: null
|
badge: null
|
||||||
}]
|
}]
|
||||||
|
|
||||||
if (response) {
|
if (response && response.length > 0) {
|
||||||
arr.push({
|
arr.push({
|
||||||
tab: 'Response',
|
tab: 'Response',
|
||||||
badge: null
|
badge: null
|
||||||
@ -71,7 +71,7 @@ export const AutoRepresentation: React.FC<any> = ({ representation, color, opene
|
|||||||
{getOpenedTabIndex() === TabsEnum.Request && <React.Fragment>
|
{getOpenedTabIndex() === TabsEnum.Request && <React.Fragment>
|
||||||
<SectionsRepresentation data={request} color={color} requestRepresentation={request} />
|
<SectionsRepresentation data={request} color={color} requestRepresentation={request} />
|
||||||
</React.Fragment>}
|
</React.Fragment>}
|
||||||
{response && getOpenedTabIndex() === TabsEnum.Response && <React.Fragment>
|
{response && response.length > 0 && getOpenedTabIndex() === TabsEnum.Response && <React.Fragment>
|
||||||
<SectionsRepresentation data={response} color={color} />
|
<SectionsRepresentation data={response} color={color} />
|
||||||
</React.Fragment>}
|
</React.Fragment>}
|
||||||
</div>}
|
</div>}
|
||||||
|
@ -28,10 +28,6 @@ const SectionsRepresentation: React.FC<any> = ({ data, color }) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sections.length === 0) {
|
|
||||||
sections.push(<div>This request or response has no data.</div>);
|
|
||||||
}
|
|
||||||
|
|
||||||
return <React.Fragment>{sections}</React.Fragment>;
|
return <React.Fragment>{sections}</React.Fragment>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user