fix: correct mobileView initial state and add SpaceSettings tab reset

- UserSettings: change mobileView default from 'content' to 'tabs'
- SpaceSettings: add useEffect to reset tab and mobileView on modal open
This commit is contained in:
Jannis Braun
2026-03-22 02:26:15 +01:00
parent e87cab58bf
commit 1f3d10842d
2 changed files with 9 additions and 1 deletions
@@ -282,6 +282,14 @@ export function SpaceSettingsModal() {
const canManageRoles = hasPermissionBit(mySpacePerms, PermissionBits.MANAGE_ROLES);
const canBanMembers = hasPermissionBit(mySpacePerms, PermissionBits.BAN_MEMBERS);
// Reset tab and mobile view when modal opens
useEffect(() => {
if (isOpen) {
setTab('overview');
setMobileView('tabs');
}
}, [isOpen]);
if (!space || !currentSpaceId) return null;
const tabClass = (t: typeof tab) =>
@@ -21,7 +21,7 @@ export function UserSettingsModal() {
const logout = useAuthStore((s) => s.logout);
const [tab, setTab] = useState<SettingsTab>('account');
const [mobileView, setMobileView] = useState<'tabs' | 'content'>('content');
const [mobileView, setMobileView] = useState<'tabs' | 'content'>('tabs');
const isOpen = activeModal === 'userSettings';