mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-06 14:56:23 +01:00
Fix response viewer stream scrolling
This commit is contained in:
1 parent
bbf85c953d
commit
cf9882b5b9
5 files changed
+46
-37
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { useCallback, useState } from 'react';
|
||||
import { generateId } from '../lib/generateId';
|
||||
|
||||
export function useRandomKey() {
|
||||
const [value, setValue] = useState<string>(generateId());
|
||||
export function useRandomKey(initialValue?: string) {
|
||||
const [value, setValue] = useState<string>(initialValue ?? generateId());
|
||||
const regenerate = useCallback(() => setValue(generateId()), []);
|
||||
return [value, regenerate] as const;
|
||||
}
|
||||
@@ -10,6 +10,7 @@ export function useResponseBodyText({
|
||||
filter: string | null;
|
||||
}) {
|
||||
return useQuery({
|
||||
placeholderData: (prev) => prev, // Keep previous data on refetch
|
||||
queryKey: [
|
||||
'response_body_text',
|
||||
response.id,
|
||||
|
||||
Reference in new issue
Block a user