Skip to content

Commit

Permalink
Fix navigation for invalid realm paths
Browse files Browse the repository at this point in the history
We screwed this up in c502b43. Weird
how I only noticed this now.
  • Loading branch information
LukasKalbertodt committed Jul 9, 2024
1 parent df20cda commit 121a6df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/routes/Realm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,14 @@ export const RealmRoute = makeRoute({
render: () => <RootLoader
{...{ query, queryRef }}
nav={data => {
if (!data.realm) {
if (realmPath.startsWith("/@") && !data.realm) {
return <ManageNav active={realmPath as `/@${string}`} />;
}

if (!data.realm) {
return [];
}

const mainNav = <Nav key="nav" fragRef={data.realm} />;
return data.realm.canCurrentUserModerate
? [mainNav, <RealmEditLinks key="edit-buttons" path={realmPath} />]
Expand Down

0 comments on commit 121a6df

Please sign in to comment.