mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-31 22:43:11 +02:00
Preserve Editor State (#151)
This commit is contained in:
@@ -110,7 +110,7 @@ function ActualEventStreamViewer({ response }: Props) {
|
||||
function FormattedEditor({ text, language }: { text: string; language: EditorProps['language'] }) {
|
||||
const formatted = useFormatText({ text, language, pretty: true });
|
||||
if (formatted.data == null) return null;
|
||||
return <Editor readOnly defaultValue={formatted.data} language={language} />;
|
||||
return <Editor readOnly defaultValue={formatted.data} language={language} stateKey={null} />;
|
||||
}
|
||||
|
||||
function EventStreamEventsVirtual({
|
||||
|
||||
@@ -89,6 +89,7 @@ export function TextViewer({
|
||||
defaultValue={filterText}
|
||||
onKeyDown={(e) => e.key === 'Escape' && toggleSearch()}
|
||||
onChange={setFilterText}
|
||||
stateKey={`filter.${responseId}`}
|
||||
/>
|
||||
</div>,
|
||||
);
|
||||
@@ -113,6 +114,7 @@ export function TextViewer({
|
||||
isSearching,
|
||||
language,
|
||||
requestId,
|
||||
responseId,
|
||||
setFilterText,
|
||||
toggleSearch,
|
||||
]);
|
||||
@@ -165,6 +167,7 @@ export function TextViewer({
|
||||
language={language}
|
||||
actions={actions}
|
||||
extraExtensions={extraExtensions}
|
||||
stateKey={null}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user