Skip to content

Commit

Permalink
remove some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Sep 9, 2024
1 parent 14f90af commit ba8f6fc
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions web/src/app/chat/ChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,7 @@ export function ChatPage({
const chatSession = (await response.json()) as BackendChatSession;
setSelectedAssistantFromId(chatSession.persona_id);

console.log("GETTING CHAT SESSION");
console.log("legnth is ", chatSession.messages.length);
const newMessageMap = processRawChatHistory(chatSession.messages);
console.log(chatSession.messages.length);
const newMessageHistory = buildLatestMessageChain(newMessageMap);

// Update message history except for edge where where
Expand Down Expand Up @@ -1572,14 +1569,11 @@ export function ChatPage({
return new Map([[chatSessionIdRef.current, initialRange]]);
});

console.log(visibleRange);

const updateVisibleRangeForCurrentSession = (newRange: {
start: number;
end: number;
mostVisibleMessageId: number | null;
}) => {
console.log("Updating visible range for current session:", newRange);
setVisibleRange((prevState) => {
const newState = new Map(prevState);
newState.set(currentSessionId(), newRange);
Expand All @@ -1588,13 +1582,11 @@ export function ChatPage({
};

useEffect(() => {
console.log("HII");
if (
messageHistory.length > 0 &&
(!visibleRange.get(currentSessionId()) ||
visibleRange.get(currentSessionId())?.end == 0)
) {
console.log("Udpating");
const newEnd = Math.max(messageHistory.length, 40);
const newStart = Math.max(0, newEnd - 40);
const newMostVisibleMessageId = messageHistory[newEnd - 1].messageId;
Expand All @@ -1606,13 +1598,6 @@ export function ChatPage({
});
hasBeenInitialized.current = true;
} else {
console.log("Not updating because", {
messageHistoryLength: messageHistory.length,
currentVisibleRange: visibleRange.get(currentSessionId()),
hasBeenInitialized: hasBeenInitialized.current,
});
console.log("Not updating");
console.log(messageHistory.length);
}
}, [router, messageHistory, currentSessionId()]);

Expand Down Expand Up @@ -1677,9 +1662,6 @@ export function ChatPage({

useEffect(() => {
if (currentVisibleRange.mostVisibleMessageId !== null) {
// Update any necessary state or perform actions based on the most visible message
// console.log("Most visible message ID:", visibleRange.mostVisibleMessageId);
// For example, you might want to update the selected message for document display:
setSelectedMessageForDocDisplay(currentVisibleRange.mostVisibleMessageId);
}
}, [currentVisibleRange.mostVisibleMessageId]);
Expand Down Expand Up @@ -1982,17 +1964,6 @@ export function ChatPage({
? messageMap.get(message.parentMessageId)
: null;

{
/* {messageHistory.map((message, i) => {
const messageMap = currentMessageMap(
completeMessageDetail
);
const messageReactComponentKey = `${i}-${currentSessionId()}`;
const parentMessage = message.parentMessageId
? messageMap.get(message.parentMessageId)
: null; */
}

if (
currentSessionRegenerationState?.regenerating &&
message.messageId >
Expand Down

0 comments on commit ba8f6fc

Please sign in to comment.