Account switcher toggle in config

This commit is contained in:
7w1 committed 2026-02-24 10:32:58 -06:00
1 parent 548a4f8e9e
commit f1ab2e8007
5 files changed
+15

No files matched your search

+1
View File
@@ -5,6 +5,7 @@
- (potentially) fixed rare crash when changing rooms
- Support Commet bios.
- Raise bio limit to 1024 characters.
- Account switcher toggle in config.json.
## Version 1.0.0
+2
View File
@@ -21,6 +21,8 @@ After that, you can copy the dist/ directory to your server and serve it.
* The default homeservers and explore pages are defined in [`config.json`](config.json).
* You can also disable the account switcher in the config.json.
* To deploy on subdirectory, you need to rebuild the app youself after updating the `base` path in [`build.config.ts`](build.config.ts).
* For example, if you want to deploy on `https://sable.moe/app`, then set `base: '/app'`.
+2
View File
@@ -4,6 +4,8 @@
"allowCustomHomeservers": true,
"elementCallUrl": null,
"disableAccountSwitcher": false,
"featuredCommunities": {
"openAsDefault": false,
"spaces": [
+2
View File
@@ -11,6 +11,8 @@ export type ClientConfig = {
allowCustomHomeservers?: boolean;
elementCallUrl?: string;
disableAccountSwitcher?: boolean;
featuredCommunities?: {
openAsDefault?: boolean;
spaces?: string[];
@@ -31,6 +31,7 @@ import { useMediaAuthentication } from '../../../hooks/useMediaAuthentication';
import { useSessionProfiles } from '../../../hooks/useSessionProfiles'; import { Settings } from '../../../features/settings';
import { Modal500 } from '../../../components/Modal500';
import { createLogger } from '../../../utils/debug';
import { useClientConfig } from '../../../hooks/useClientConfig';
const log = createLogger('AccountSwitcherTab');
@@ -141,8 +142,15 @@ export function AccountSwitcherTab() {
const sessionProfiles = useSessionProfiles(sessions);
const { disableAccountSwitcher } = useClientConfig();
const handleToggle: MouseEventHandler<HTMLButtonElement> = (evt) => {
if (disableAccountSwitcher) {
setSettingsOpen(true);
return;
}
const cords = evt.currentTarget.getBoundingClientRect();
setMenuAnchor((cur) => (cur ? undefined : cords));
};