playing nicely automatically!!!

This commit is contained in:
Arjun Patel
2022-01-16 13:40:45 -08:00
parent 8b8cdbef92
commit ff454d10f0
2 changed files with 54 additions and 23 deletions
+7 -4
View File
@@ -176,8 +176,6 @@ export function TeamDashboardContextProvider({ children }) {
// listener for all incoming messages
useEffect(() => {
console.log("first only");
// todo for new messages, change document.title
/**
@@ -207,7 +205,6 @@ export function TeamDashboardContextProvider({ children }) {
// update map of teammate to relevant messages
setMessagesByTeamMate((prevMap) => {
console.log("settting state");
// if the map contains the teammate userid already, then cool, just unshift to that array
const newMap = { ...prevMap };
if (newMessage.receiverUserId in prevMap) {
@@ -238,8 +235,14 @@ export function TeamDashboardContextProvider({ children }) {
return <Loading />;
}
const transformedValue = {
...value,
allMessages,
messagesByTeamMate,
};
return (
<TeamDashboardContext.Provider value={value}>
<TeamDashboardContext.Provider value={transformedValue}>
{children}
</TeamDashboardContext.Provider>
);