mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 20:00:29 +01:00
Handle no text
This commit is contained in:
@@ -2,6 +2,7 @@ import type { HttpResponse } from '@yaakapp-internal/models';
|
||||
import { useResponseBodyText } from '../../hooks/useResponseBodyText';
|
||||
import { languageFromContentType } from '../../lib/contentType';
|
||||
import { getContentTypeFromHeaders } from '../../lib/model_util';
|
||||
import { EmptyStateText } from '../EmptyStateText';
|
||||
import { TextViewer } from './TextViewer';
|
||||
import { WebPageViewer } from './WebPageViewer';
|
||||
|
||||
@@ -22,6 +23,8 @@ export function HTMLOrTextViewer({ response, pretty, textViewerClassName }: Prop
|
||||
|
||||
if (language === 'html' && pretty) {
|
||||
return <WebPageViewer response={response} />;
|
||||
} else if (rawTextBody.data == null) {
|
||||
return <EmptyStateText>Empty response</EmptyStateText>
|
||||
} else {
|
||||
return (
|
||||
<TextViewer
|
||||
|
||||
Reference in New Issue
Block a user