Skip to content

Commit fdedf7c

Browse files
cpAdmCopilot
andauthored
fix: 'No payload for this request' message
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Chris <57954026+cpAdm@users.noreply.github.com>
1 parent 0d34f4a commit fdedf7c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/trace-viewer/src/ui/networkResourceDetails.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,13 @@ const PayloadTab: React.FunctionComponent<{
184184
requestBody: RequestBody,
185185
}> = ({ resource, requestBody }) => {
186186
const [showFormatted, setShowFormatted] = useSetting('trace-viewer-network-details-show-formatted-payload', true);
187+
const hasQueryString = resource.request.queryString.length > 0;
188+
const hasRequestBody = !!(requestBody || resource.request.postData);
187189
const formatResult = useFormattedBody(requestBody, showFormatted);
188190

189191
return <div className='vbox network-request-details-tab'>
190-
{resource.request.queryString.length === 0 && !requestBody && <em className='network-request-no-payload'>No payload for this request.</em>}
191-
{resource.request.queryString.length > 0 && <ExpandableSection title='Query String Parameters' showCount data={resource.request.queryString}/>}
192+
{!hasQueryString && !hasRequestBody && <em className='network-request-no-payload'>No payload for this request.</em>}
193+
{hasQueryString && <ExpandableSection title='Query String Parameters' showCount data={resource.request.queryString}/>}
192194
{requestBody && <ExpandableSection title='Request Body' className='network-request-request-body' titleChildren={
193195
<>
194196
<div style={{ margin: 'auto' }}></div>

0 commit comments

Comments
 (0)