Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/show-account-switcher-hs-down.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Add account switcher to "homeserver down" screen to prevent being locked out from all accounts at once
4 changes: 4 additions & 0 deletions src/app/pages/client/SpecVersions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { SpecVersionsProvider } from '$hooks/useSpecVersions';
import { SplashScreen } from '$components/splash-screen';
import { useMatrixClient } from '$hooks/useMatrixClient';
import type { SpecVersions } from '../../cs-api';
import { AccountMenuOption } from './sidebar/UserMenuTab';

const EMPTY_VERSIONS: SpecVersions = { versions: [] };

Expand All @@ -25,6 +26,9 @@ function HomeserverOfflineError({ baseUrl, onRetry }: HomeserverOfflineErrorProp
We can&apos;t reach <strong>{baseUrl}</strong>. The homeserver may be down, or you
may have a connection issue. Please try again.
</Text>
<div style={{ position: 'relative' }}>
<AccountMenuOption isMobile={true} showSeparator={false} />
</div>
</Box>
<Button variant="Critical" onClick={onRetry} fill="Soft">
<Text as="span" size="B400">
Expand Down
12 changes: 10 additions & 2 deletions src/app/pages/client/sidebar/UserMenuTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,15 @@ function AccountRow({
);
}

export function AccountMenuOption({ isMobile, isRight }: { isMobile: boolean; isRight?: boolean }) {
export function AccountMenuOption({
isMobile,
isRight,
showSeparator,
}: {
isMobile: boolean;
isRight?: boolean;
showSeparator?: boolean;
}) {
const mx = useMatrixClient();
const navigate = useNavigate();
const sessions = useAtomValue(sessionsAtom);
Expand Down Expand Up @@ -265,7 +273,7 @@ export function AccountMenuOption({ isMobile, isRight }: { isMobile: boolean; is

return (
<>
<Line variant="Surface" size="300" />
{(showSeparator ?? true) && <Line variant="Surface" size="300" />}
<Box direction="Column" gap="100" style={{ padding: config.space.S100 }}>
<MenuItem
size="300"
Expand Down
Loading