fix(gateway): preserve configured server display order
This commit is contained in:
@@ -4,6 +4,7 @@ import type {
|
||||
GatewayProfileRepository,
|
||||
GatewayProfileStatus,
|
||||
} from '../orchestrator/profileRepository.js';
|
||||
import { orderGatewayProfiles } from '../profileOrder.js';
|
||||
|
||||
export type LobbyMapSnapshot = {
|
||||
updatedAt: string | null;
|
||||
@@ -47,7 +48,7 @@ export class InMemoryProfileStatusService implements GatewayProfileStatusService
|
||||
}
|
||||
|
||||
async listLobbyProfiles(): Promise<LobbyProfileStatus[]> {
|
||||
return this.profiles;
|
||||
return orderGatewayProfiles(this.profiles);
|
||||
}
|
||||
|
||||
setProfiles(profiles: LobbyProfileStatus[]): void {
|
||||
@@ -63,7 +64,7 @@ export class RepositoryProfileStatusService implements GatewayProfileStatusServi
|
||||
) {}
|
||||
|
||||
async listLobbyProfiles(): Promise<LobbyProfileStatus[]> {
|
||||
const rows = await this.profiles.listProfiles();
|
||||
const rows = orderGatewayProfiles(await this.profiles.listProfiles());
|
||||
const runtimeStates = await this.orchestrator.listRuntimeStates(rows.map((profile) => profile.profileName));
|
||||
const runtimeMap = new Map(runtimeStates.map((state) => [state.profileName, state]));
|
||||
return rows.map((row) => this.mapProfile(row, runtimeMap));
|
||||
|
||||
Reference in New Issue
Block a user