diff --git a/src/components/PageComponents/Messages/ChannelChat.tsx b/src/components/PageComponents/Messages/ChannelChat.tsx index 79950bf8..fd0d2c8e 100644 --- a/src/components/PageComponents/Messages/ChannelChat.tsx +++ b/src/components/PageComponents/Messages/ChannelChat.tsx @@ -1,28 +1,28 @@ import { Subtle } from "@app/components/UI/Typography/Subtle.tsx"; -import { - type MessageWithState, - useDevice, -} from "@app/core/stores/deviceStore.ts"; +import { useDevice } from "@app/core/stores/deviceStore.ts"; +import { MessageStore } from "@app/core/stores/messageStore.ts"; import { Message } from "@components/PageComponents/Messages/Message.tsx"; import { MessageInput } from "@components/PageComponents/Messages/MessageInput.tsx"; import { TraceRoute } from "@components/PageComponents/Messages/TraceRoute.tsx"; import type { Protobuf, Types } from "@meshtastic/js"; import { InboxIcon } from "lucide-react"; +import { useState, useEffect, useRef } from 'react'; export interface ChannelChatProps { - messages?: MessageWithState[]; + messageStore: MessageStore; channel: Types.ChannelNumber; to: Types.Destination; traceroutes?: Types.PacketMetadata[]; } export const ChannelChat = ({ - messages, + messageStore, channel, to, traceroutes, }: ChannelChatProps): JSX.Element => { const { nodes } = useDevice(); + const messages = messageStore.messages; return (
diff --git a/src/components/PageLayout.tsx b/src/components/PageLayout.tsx index 79495bdc..33d7f0b4 100644 --- a/src/components/PageLayout.tsx +++ b/src/components/PageLayout.tsx @@ -18,6 +18,7 @@ export const PageLayout = ({ noPadding, actions, children, + onScroll, }: PageLayoutProps): JSX.Element => { return ( <> @@ -52,6 +53,7 @@ export const PageLayout = ({ "flex h-full w-full flex-col overflow-y-auto", !noPadding && "pl-3 pr-3 ", )} + onScroll={onScroll} > {children}