Cleaning up comments

This commit is contained in:
2026-03-06 05:21:41 +01:00
parent fe2347b54e
commit 10467dfccb
50 changed files with 51 additions and 885 deletions

View File

@@ -1,38 +1,22 @@
import { Injectable, signal } from '@angular/core';
/**
* Pages available in the unified settings modal.
* Network & Voice are always visible; server-specific pages
* require an active room and admin role.
*/
export type SettingsPage = 'network' | 'voice' | 'server' | 'members' | 'bans' | 'permissions';
/**
* Global service controlling the unified settings modal.
* Any component can open the modal to a specific page via `open()`.
*/
@Injectable({ providedIn: 'root' })
export class SettingsModalService {
/** Whether the modal is currently visible. */
readonly isOpen = signal(false);
/** The currently active page within the side-nav. */
readonly activePage = signal<SettingsPage>('network');
/** Optional server/room ID to pre-select in admin tabs. */
readonly targetServerId = signal<string | null>(null);
/** Open the modal to a specific page, optionally targeting a server. */
open(page: SettingsPage = 'network', serverId?: string): void {
this.activePage.set(page);
this.targetServerId.set(serverId ?? null);
this.isOpen.set(true);
}
/** Close the modal. */
close(): void {
this.isOpen.set(false);
}
/** Navigate to a different page while the modal remains open. */
navigate(page: SettingsPage): void {
this.activePage.set(page);
}