FIX: Ignore Default category (parity with beta)

Just a little change so people still using Revite don't need to see an ugly "Default" category.
pull/1142/head
Asraye 2025-08-31 03:40:33 +10:00
parent f9c2fcec56
commit cbdeb1ba6d
1 changed files with 16 additions and 10 deletions

View File

@ -50,8 +50,10 @@ const ServerList = styled.div`
export default observer(() => { export default observer(() => {
const client = useClient(); const client = useClient();
const state = useApplicationState(); const state = useApplicationState();
const { server: server_id, channel: channel_id } = const { server: server_id, channel: channel_id } = useParams<{
useParams<{ server: string; channel?: string }>(); server: string;
channel?: string;
}>();
const server = client.servers.get(server_id); const server = client.servers.get(server_id);
if (!server) return <Redirect to="/" />; if (!server) return <Redirect to="/" />;
@ -119,14 +121,18 @@ export default observer(() => {
channels.push(addChannel(id)); channels.push(addChannel(id));
} }
elements.push( if (category.title === "Default") {
<CollapsibleSection elements.push(...channels);
id={`category_${category.id}`} } else {
defaultValue elements.push(
summary={<Category>{category.title}</Category>}> <CollapsibleSection
{channels} id={`category_${category.id}`}
</CollapsibleSection>, defaultValue
); summary={<Category>{category.title}</Category>}>
{channels}
</CollapsibleSection>,
);
}
} }
} }