mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
fix(frontend): Reduce delta calculating message rate and fix modal import (#5387)
This commit is contained in:
parent
0dde1602c2
commit
43e074c3ed
@ -1,6 +1,6 @@
|
||||
import { act, renderHook } from "@testing-library/react";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { useRate } from "#/utils/use-rate";
|
||||
import { useRate } from "#/hooks/use-rate";
|
||||
|
||||
describe("useRate", () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { ModalBody } from "@nextui-org/react";
|
||||
import GitHubLogo from "#/assets/branding/github-logo.svg?react";
|
||||
import AllHandsLogo from "#/assets/branding/all-hands-logo.svg?react";
|
||||
import { JoinWaitlistAnchor } from "./join-waitlist-anchor";
|
||||
import { WaitlistMessage } from "./waitlist-message";
|
||||
import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";
|
||||
import { ModalButton } from "#/components/shared/buttons/modal-button";
|
||||
import { ModalBody } from "#/components/shared/modals/modal-body";
|
||||
|
||||
interface WaitlistModalProps {
|
||||
ghToken: string | null;
|
||||
|
||||
@ -6,7 +6,7 @@ import ActionType from "#/types/action-type";
|
||||
import EventLogger from "#/utils/event-logger";
|
||||
import AgentState from "#/types/agent-state";
|
||||
import { handleAssistantMessage } from "#/services/actions";
|
||||
import { useRate } from "#/utils/use-rate";
|
||||
import { useRate } from "#/hooks/use-rate";
|
||||
|
||||
const isOpenHandsMessage = (event: Record<string, unknown>) =>
|
||||
event.action === "message";
|
||||
@ -58,7 +58,7 @@ export function WsClientProvider({
|
||||
const [events, setEvents] = React.useState<Record<string, unknown>[]>([]);
|
||||
const lastEventRef = React.useRef<Record<string, unknown> | null>(null);
|
||||
|
||||
const messageRateHandler = useRate({ threshold: 500 });
|
||||
const messageRateHandler = useRate({ threshold: 250 });
|
||||
|
||||
function send(event: Record<string, unknown>) {
|
||||
if (!sioRef.current) {
|
||||
|
||||
@ -6,7 +6,7 @@ import { Controls } from "#/components/features/controls/controls";
|
||||
import { RootState } from "#/store";
|
||||
import { clearMessages } from "#/state/chat-slice";
|
||||
import { clearTerminal } from "#/state/command-slice";
|
||||
import { useEffectOnce } from "#/utils/use-effect-once";
|
||||
import { useEffectOnce } from "#/hooks/use-effect-once";
|
||||
import CodeIcon from "#/icons/code.svg?react";
|
||||
import GlobeIcon from "#/icons/globe.svg?react";
|
||||
import ListIcon from "#/icons/list-type-number.svg?react";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user