From c33ce3d03a578be1bb16e15101c48f4e92d5e200 Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 25 Feb 2026 11:05:52 -0600 Subject: [PATCH] fixed chats not loading --- src/app/HeaderButtons.tsx | 6 +++--- src/chat/Chat.tsx | 1 + src/chat/ChatDrawer.tsx | 7 +------ src/providers/pond/noteAPI.tsx | 26 ++++++++++++++------------ 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/app/HeaderButtons.tsx b/src/app/HeaderButtons.tsx index 18e2f7d..6f8f853 100644 --- a/src/app/HeaderButtons.tsx +++ b/src/app/HeaderButtons.tsx @@ -12,7 +12,7 @@ import { useTeamAPI } from "providers"; import { cloneDeep } from "lodash"; -const useStyles = makeStyles((theme: Theme) => ({ +const useStyles = makeStyles((theme: Theme) => ({ button: { color: getSignatureAccentColour(), width: theme.spacing(6), @@ -70,8 +70,8 @@ export default function HeaderButtons(props: Props) { setHasNewChats(true); return; } - console.log(team.preferences.chatViewedTimestamp) - console.log(team.settings.lastChatTimestamp) + // console.log(team.preferences.chatViewedTimestamp) + // console.log(team.settings.lastChatTimestamp) let viewMoment = moment(team.preferences.chatViewedTimestamp); let chatMoment = moment(team.settings.lastChatTimestamp); if (viewMoment.diff(chatMoment) < 0) { diff --git a/src/chat/Chat.tsx b/src/chat/Chat.tsx index 5b5c8dd..f360ed7 100644 --- a/src/chat/Chat.tsx +++ b/src/chat/Chat.tsx @@ -37,6 +37,7 @@ export default function Chat(props: Props) { const loadChats = () => { setLoading(true) + // console.log("listing chats?") noteAPI.listChats(10, chats.length, "desc", "timestamp", objectKey).then(resp => { setChats(resp.data.chats ? resp.data.chats.reverse().concat(chats) : []) setTotalMessages(resp.data.total) diff --git a/src/chat/ChatDrawer.tsx b/src/chat/ChatDrawer.tsx index 1c2c9e9..534b950 100644 --- a/src/chat/ChatDrawer.tsx +++ b/src/chat/ChatDrawer.tsx @@ -46,7 +46,7 @@ export function ChatDrawer(props: Props) { const isMobile = useMobile(); const classes = useStyles() - console.log(team.settings.avatar) + // console.log(team.settings.avatar) return ( - {/* Add your icons here */} - {/* */} - - {/* */} - {/* Main chat area */} diff --git a/src/providers/pond/noteAPI.tsx b/src/providers/pond/noteAPI.tsx index 259cd61..3cd4f91 100644 --- a/src/providers/pond/noteAPI.tsx +++ b/src/providers/pond/noteAPI.tsx @@ -1,7 +1,7 @@ import { AxiosResponse } from "axios"; import { useHTTP } from "hooks"; import { pond } from "protobuf-ts/pond"; -import { useGlobalState } from "providers"; +// import { useGlobalState } from "providers"; import { createContext, PropsWithChildren, useContext } from "react"; import { pondURL } from "./pond"; @@ -37,7 +37,7 @@ interface Props {} export default function NoteProvider(props: PropsWithChildren) { const { children } = props; const { get, del, post, put } = useHTTP(); - const [{as}] = useGlobalState() + // const [{as}] = useGlobalState() const addNote = (note: pond.NoteSettings, attachments?: string[]) => { let url = pondURL("/notes" + (attachments ? "?attachments=" + attachments.toString() : "")) @@ -88,9 +88,9 @@ export default function NoteProvider(props: PropsWithChildren) { orderBy?: string, search?: string, asRoot?: boolean, - otherTeam?: string + // otherTeam?: string ) => { - const view = otherTeam ? otherTeam : as + // const view = otherTeam ? otherTeam : as let url = pondURL( "/notes" + "?limit=" + @@ -100,9 +100,10 @@ export default function NoteProvider(props: PropsWithChildren) { ("&order=" + (order ? order : "asc")) + ("&by=" + (orderBy ? orderBy : "key")) + (search ? "&search=" + search : "") + - (asRoot ? "&asRoot=" + asRoot.toString() : "") + - (view ? "&as=" + view : "") + (asRoot ? "&asRoot=" + asRoot.toString() : ""), + // (view ? "&as=" + "" : "") ) + // console.log(url) return new Promise>((resolve, reject) => { get(url).then(resp => { resp.data = pond.ListNotesResponse.fromObject(resp.data) @@ -119,10 +120,10 @@ export default function NoteProvider(props: PropsWithChildren) { order?: "asc" | "desc", orderBy?: string, search?: string, - asRoot?: boolean, - otherTeam?: string + // asRoot?: boolean, + // otherTeam?: string ) => { - const view = otherTeam ? otherTeam : as + // const view = otherTeam ? otherTeam : as let url = pondURL( "/chats" + "?limit=" + @@ -131,10 +132,11 @@ export default function NoteProvider(props: PropsWithChildren) { offset + ("&order=" + (order ? order : "asc")) + ("&by=" + (orderBy ? orderBy : "key")) + - (search ? "&search=" + search : "") + - (asRoot ? "&asRoot=" + asRoot.toString() : "") + - (view ? "&as=" + view : "") + (search ? "&search=" + search : ""), + // (asRoot ? "&asRoot=" + asRoot.toString() : ""), + // (view ? "&as=" + view : "") ) + // console.log(asRoot) return new Promise>((resolve, reject) => { get(url).then(resp => { resp.data = pond.ListChatsResponse.fromObject(resp.data)