mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
fix rerenders (#6272)
This commit is contained in:
parent
3eedddc073
commit
bd23cfeb69
@ -29,7 +29,7 @@ import { Pane, PaneHeader } from './pane';
|
||||
import { PlaceholderResponsePane } from './placeholder-response-pane';
|
||||
|
||||
interface Props {
|
||||
runningRequests: Record<string, number>;
|
||||
runningRequests: Record<string, boolean>;
|
||||
}
|
||||
export const ResponsePane: FC<Props> = ({
|
||||
runningRequests,
|
||||
|
@ -109,13 +109,15 @@ export const Debug: FC = () => {
|
||||
settings,
|
||||
} = useRouteLoaderData('root') as RootLoaderData;
|
||||
const { sidebarFilter } = activeWorkspaceMeta;
|
||||
const [runningRequests, setRunningRequests] = useState({});
|
||||
const [runningRequests, setRunningRequests] = useState<Record<string, boolean>>({});
|
||||
const setLoading = (isLoading: boolean) => {
|
||||
invariant(requestId, 'No active request');
|
||||
setRunningRequests({
|
||||
...runningRequests,
|
||||
[requestId]: isLoading ? true : false,
|
||||
});
|
||||
if (runningRequests?.[requestId] !== isLoading) {
|
||||
setRunningRequests({
|
||||
...runningRequests,
|
||||
[requestId]: isLoading ? true : false,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const grpcState = grpcStates.find(s => s.requestId === requestId);
|
||||
|
Loading…
Reference in New Issue
Block a user