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.
master
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,6 +121,9 @@ export default observer(() => {
channels.push(addChannel(id)); channels.push(addChannel(id));
} }
if (category.title === "Default") {
elements.push(...channels);
} else {
elements.push( elements.push(
<CollapsibleSection <CollapsibleSection
id={`category_${category.id}`} id={`category_${category.id}`}
@ -129,6 +134,7 @@ export default observer(() => {
); );
} }
} }
}
for (const id of Array.from(uncategorised).reverse()) { for (const id of Array.from(uncategorised).reverse()) {
elements.unshift(addChannel(id)); elements.unshift(addChannel(id));