nicolium: fix chats page display with just a shoutbox

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-09 09:14:42 +01:00
parent 1eb2e10a7d
commit ce120faa23

View File

@ -5,6 +5,7 @@ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
import Stack from '@/components/ui/stack';
import { chatsEmptyRoute } from '@/features/ui/router';
import { useChats } from '@/queries/chats';
import { useShoutboxIsLoading } from '@/stores/shoutbox';
import ChatsPageSidebar from './components/chats-page-sidebar';
@ -12,9 +13,11 @@ const ChatsPage: React.FC = () => {
const {
chatsQuery: { data: chats },
} = useChats();
const showShoutbox = !useShoutboxIsLoading();
const isSidebarHidden =
!useMatch({ from: chatsEmptyRoute.id, shouldThrow: false }) || chats?.length === 0;
!useMatch({ from: chatsEmptyRoute.id, shouldThrow: false }) ||
(chats?.length === 0 && !showShoutbox);
const containerRef = useRef<HTMLDivElement>(null);
const [height, setHeight] = useState<string | number>('100%');