Update Terminal.tsx
This commit is contained in:
@@ -185,9 +185,8 @@ export function TerminalProvider({ children }: { children?: React.ReactNode }) {
|
||||
useEffect(() => {
|
||||
// go through all conversations
|
||||
Object.keys(conversationMap).forEach((conversationId) => {
|
||||
setContentListeners((draftListeners) => {
|
||||
// if we have a listener for conversation already, then just move on
|
||||
if (draftListeners[conversationId]) return;
|
||||
if (contentListeners[conversationId]) return;
|
||||
|
||||
// if we don't, then create one for this conversation
|
||||
const contentListener = onSnapshot(
|
||||
@@ -218,7 +217,7 @@ export function TerminalProvider({ children }: { children?: React.ReactNode }) {
|
||||
);
|
||||
|
||||
//add to map of listeners
|
||||
|
||||
setContentListeners((draftListeners) => {
|
||||
draftListeners[conversationId] = contentListener;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user