mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-06-12 09:24:29 +02: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 { useResponseBodyText } from '../../hooks/useResponseBodyText';
|
||||||
import { languageFromContentType } from '../../lib/contentType';
|
import { languageFromContentType } from '../../lib/contentType';
|
||||||
import { getContentTypeFromHeaders } from '../../lib/model_util';
|
import { getContentTypeFromHeaders } from '../../lib/model_util';
|
||||||
|
import { EmptyStateText } from '../EmptyStateText';
|
||||||
import { TextViewer } from './TextViewer';
|
import { TextViewer } from './TextViewer';
|
||||||
import { WebPageViewer } from './WebPageViewer';
|
import { WebPageViewer } from './WebPageViewer';
|
||||||
|
|
||||||
@@ -22,6 +23,8 @@ export function HTMLOrTextViewer({ response, pretty, textViewerClassName }: Prop
|
|||||||
|
|
||||||
if (language === 'html' && pretty) {
|
if (language === 'html' && pretty) {
|
||||||
return <WebPageViewer response={response} />;
|
return <WebPageViewer response={response} />;
|
||||||
|
} else if (rawTextBody.data == null) {
|
||||||
|
return <EmptyStateText>Empty response</EmptyStateText>
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<TextViewer
|
<TextViewer
|
||||||
|
|||||||
Reference in New Issue
Block a user