mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
refactor(server): drop the state helpers the injected stores replaced
setPermissionsCache and the free leaveRoom, leaveAllRooms and leaveAllBooks lost their last caller when the services moved onto the injected stores.
This commit is contained in:
@@ -59,11 +59,6 @@ export function getPermissionsCache(): Promise<Map<string, PermissionLevel> | nu
|
||||
return permissionsCacheSlot.get().get();
|
||||
}
|
||||
|
||||
/** Install a fresh cache map and return it (the loader fills it in place). */
|
||||
export function setPermissionsCache(next: Map<string, PermissionLevel>): Promise<Map<string, PermissionLevel>> {
|
||||
return permissionsCacheSlot.get().set(next);
|
||||
}
|
||||
|
||||
export function invalidatePermissionsCache(): Promise<void> {
|
||||
return permissionsCacheSlot.get().invalidate();
|
||||
}
|
||||
|
||||
@@ -174,14 +174,6 @@ export function joinRoom(ws: TrekWebSocket, tripId: number): void {
|
||||
roomsSlot.get().join(ws, tripId);
|
||||
}
|
||||
|
||||
export function leaveRoom(ws: TrekWebSocket, tripId: number): void {
|
||||
roomsSlot.get().leave(ws, tripId);
|
||||
}
|
||||
|
||||
export function leaveAllRooms(ws: TrekWebSocket): void {
|
||||
roomsSlot.get().leaveAll(ws);
|
||||
}
|
||||
|
||||
// ── Studio books ──────────────────────────────────────────────────────────
|
||||
|
||||
export interface BookPeer {
|
||||
@@ -199,11 +191,6 @@ export function leaveBook(ws: TrekWebSocket, journeyId: number): void {
|
||||
roomsSlot.get().leaveBook(ws, journeyId);
|
||||
}
|
||||
|
||||
/** Every book this socket had open — called when the connection goes. */
|
||||
export function leaveAllBooks(ws: TrekWebSocket): number[] {
|
||||
return roomsSlot.get().leaveAllBooks(ws);
|
||||
}
|
||||
|
||||
/**
|
||||
* Who is in a book, by socket rather than by user.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user