Skip to content

Commit f98235a

Browse files
committed
style: Remove console.log statements and unused code
1 parent 147f815 commit f98235a

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

src/components/messages/ai/ai-related-questions.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export const AIRelatedQuestions: FC<TAIRelatedQuestions> = ({
2626
const { invokeModel } = useLLMRunner();
2727

2828
const handleOnClick = (question: string) => {
29-
console.log("question", question);
3029
const assistant = preferences.defaultAssistant;
3130

3231
const props = getAssistantByKey(assistant);

src/components/messages/recent-message.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,22 @@ export const RecentMessage = () => {
1010
const { store } = useChatContext();
1111
const currentMessage = store((state) => state.currentMessage);
1212
const isGenerating = store((state) => state.isGenerating);
13+
const prevMessagesIds = store((state) =>
14+
state.messages.map((message) => message.id),
15+
);
1316
const setIsGenerating = store((state) => state.setIsGenerating);
1417
const setCurrentMessage = store((state) => state.setCurrentMessage);
1518
const { generateTitleForSession } = useTitleGenerator();
1619
const { generateRelatedQuestion } = useRelatedQuestions();
1720
const { addMessageMutation } = useSessions();
1821
const { isAtBottom, scrollToBottom } = useScrollToBottom();
1922

23+
useEffect(() => {
24+
if (currentMessage?.id && prevMessagesIds?.includes(currentMessage?.id)) {
25+
setCurrentMessage(undefined);
26+
}
27+
}, [currentMessage?.id, prevMessagesIds?.length]);
28+
2029
useEffect(() => {
2130
if (
2231
!currentMessage ||

src/components/welcome-message/opensource-copy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const OpenSourceCopy = () => {
99
return (
1010
<>
1111
We&apos;re shipping new features every week. Check out{" "}
12-
<a href="https://llmchat.supahub.com/roadmap" className={linkClass}>
12+
<a href="https://llmchat.supahub.com" className={linkClass}>
1313
what&apos;s coming
1414
</a>{" "}
1515
or{" "}

src/helper/animations.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
export const REVEAL_ANIMATION_VARIANTS = {
2-
hidden: { opacity: 0, filter: "blur(1px)", y: -10 },
2+
hidden: { opacity: 0 },
33
visible: {
44
opacity: 1,
55
y: 0,
6-
filter: "blur(0px)",
7-
backgroundColor: "transparent",
86
transition: {
97
duration: 1,
108
ease: "easeIn",

src/hooks/use-editor.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export const useChatEditor = () => {
3939
const { editor } = props;
4040
const text = editor.getText();
4141
const html = editor.getHTML();
42-
console.log("text", html);
4342
if (text === "/") {
4443
// setOpenPromptsBotCombo(true);
4544
} else {

src/hooks/use-image-attachment.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export const useImageAttachment = () => {
2929
const [attachment, setAttachment] = useState<TAttachment>();
3030

3131
const onDrop = useCallback((acceptedFiles: File[]) => {
32-
console.log("ACCEPTED FILES", acceptedFiles);
3332
const file = acceptedFiles?.[0];
3433
readImageFile(file);
3534
}, []);

0 commit comments

Comments
 (0)