Support no level on floors (#20206)

This commit is contained in:
Bram Kragten 2024-03-27 17:15:06 +01:00 committed by GitHub
parent b662512995
commit f5ff55abc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ export interface FloorAreaLookup {
export interface FloorRegistryEntryMutableParams {
name: string;
level?: number;
level?: number | null;
icon?: string | null;
aliases?: string[];
}
@ -34,7 +34,7 @@ const fetchFloorRegistry = (conn: Connection) =>
.then((floors) =>
(floors as FloorRegistryEntry[]).sort((ent1, ent2) => {
if (ent1.level !== ent2.level) {
return (ent1.level ?? 0) - (ent2.level ?? 0);
return (ent1.level ?? 9999) - (ent2.level ?? 9999);
}
return stringCompare(ent1.name, ent2.name);
})

View File

@ -24,7 +24,7 @@ class DialogFloorDetail extends LitElement {
@state() private _icon!: string | null;
@state() private _level!: number;
@state() private _level!: number | null;
@state() private _error?: string;
@ -40,7 +40,7 @@ class DialogFloorDetail extends LitElement {
this._name = this._params.entry ? this._params.entry.name : "";
this._aliases = this._params.entry?.aliases || [];
this._icon = this._params.entry?.icon || null;
this._level = this._params.entry?.level ?? 0;
this._level = this._params.entry?.level ?? null;
await this.updateComplete;
}