Skip to content

Commit c37e81a

Browse files
committed
clean code
1 parent 5d6d4ca commit c37e81a

4 files changed

Lines changed: 6 additions & 12 deletions

File tree

src/app/(pages)/api/chatbot/history/[chatId]/route.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,6 @@ export async function POST(req: NextRequest, { params }: { params: { chatId: str
229229
chatId: chatId,
230230
response: botReply
231231
}
232-
console.log('dsssssssssssss', data)
233232
return NextResponse.json(data, { status: 200 });
234-
// } else {
235-
// return NextResponse.json({ message: 'Chat not found' }, { status: 404 });
236-
// }
233+
237234
}

src/app/components/Chat/useChat.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ export const useChat = (initialChatId: string | null) => {
8383
]);
8484

8585
if (chatBoxRef.current && previousScrollHeightRef.current) {
86-
// const newScrollTop = chatBoxRef.current.scrollHeight - previousScrollHeightRef.current;
87-
// chatBoxRef.current.scrollTop = -200;
8886
window.scrollTo({ top: previousScrollHeightRef.current })
8987
}
9088

src/store/alerts/notificationCount/saga.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ function createWebSocketChannel(url: string): EventChannel<any> {
2525
function* handleNotificationWebSocket(): Generator<any, void, any> {
2626
const notificationChannel: EventChannel<any> = yield call(createWebSocketChannel, 'ws://localhost:8081');
2727

28-
// while (true) {
29-
// const notification = yield take(notificationChannel);
30-
// yield put(incrementCount());
31-
// yield put(setLastNotification(notification));
32-
// }
28+
while (true) {
29+
const notification = yield take(notificationChannel);
30+
yield put(incrementCount());
31+
yield put(setLastNotification(notification));
32+
}
3333
}
3434

3535
function* handleAlertCountWebSocket(): Generator<any, void, any> {

src/store/chat/new/slice.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
22
import { HYDRATE } from 'next-redux-wrapper';
3-
import { ChatResponseInterface } from './chat.interface';
43

54
interface ChatState {
65
isLoading: boolean;

0 commit comments

Comments
 (0)