Cleaning up comments
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user