fix(frontend): Prevent push message from being rendered twice (#5546)

This commit is contained in:
sp.wack 2024-12-12 21:19:48 +04:00 committed by GitHub
parent ac5190c283
commit 37c46f1ed8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,9 +1,7 @@
import React from "react";
import { useDispatch } from "react-redux";
import toast from "react-hot-toast";
import posthog from "posthog-js";
import EllipsisH from "#/icons/ellipsis-h.svg?react";
import { addUserMessage } from "#/state/chat-slice";
import { createChatMessage } from "#/services/chat-service";
import { ProjectMenuCardContextMenu } from "./project.menu-card-context-menu";
import { ProjectMenuDetailsPlaceholder } from "./project-menu-details-placeholder";
@ -28,7 +26,6 @@ export function ProjectMenuCard({
githubData,
}: ProjectMenuCardProps) {
const { send } = useWsClient();
const dispatch = useDispatch();
const [contextMenuIsOpen, setContextMenuIsOpen] = React.useState(false);
const [connectToGitHubModalOpen, setConnectToGitHubModalOpen] =
@ -56,7 +53,6 @@ Please push the changes to GitHub and open a pull request.
);
send(event); // send to socket
dispatch(addUserMessage(rawEvent)); // display in chat interface
setContextMenuIsOpen(false);
};