diff --git a/src/app/(main)/chat/page.tsx b/src/app/(main)/chat/page.tsx index 0e12e71..27a72ab 100644 --- a/src/app/(main)/chat/page.tsx +++ b/src/app/(main)/chat/page.tsx @@ -18,7 +18,7 @@ export const useChatParams = () => { return { id, characterId }; }; -export default function ChatPage() { +function CharacterChatPage() { const { id, characterId } = useChatParams(); const [settingOpen, setSettingOpen] = useState(false); const switchToChannel = useStreamChatStore((s) => s.switchToChannel); @@ -52,3 +52,4 @@ export default function ChatPage() { ); } +export default CharacterChatPage; diff --git a/src/app/(main)/chat/stream-chat.ts b/src/app/(main)/chat/stream-chat.ts index 454ad26..b215682 100644 --- a/src/app/(main)/chat/stream-chat.ts +++ b/src/app/(main)/chat/stream-chat.ts @@ -166,6 +166,7 @@ export const useStreamChatStore = create((set, get) => ({ async switchToChannel(id: string) { const { client, user } = get(); const channel = client!.channel('messaging', id); + set({ currentChannel: channel, messages: [] }); const result = await protect(() => channel.query({ messages: { limit: 100 }, diff --git a/src/layout/BasicLayout/Topbar.tsx b/src/layout/BasicLayout/Topbar.tsx index 70d1cfc..0919c7b 100644 --- a/src/layout/BasicLayout/Topbar.tsx +++ b/src/layout/BasicLayout/Topbar.tsx @@ -80,7 +80,7 @@ function Topbar() { if (!response || isLoading) return null; return ( -
+
{user && } {user && ( diff --git a/src/layout/BasicLayout/components/Notice.tsx b/src/layout/BasicLayout/components/Notice.tsx index a9ed8f9..b2e21f0 100644 --- a/src/layout/BasicLayout/components/Notice.tsx +++ b/src/layout/BasicLayout/components/Notice.tsx @@ -38,19 +38,17 @@ const Notice = () => { return ( <> {user && ( -
-
setIsDrawerOpen(true)} - > -
- Notice - -
- {/* {actualIsExpanded && ( +
setIsDrawerOpen(true)} + > +
+ Notice + +
+ {/* {actualIsExpanded && ( Notice )} */} -
)}