Handle pl3xmap world ordering

This commit is contained in:
James Lyne 2021-12-10 16:36:32 +00:00
parent cbd6c7f3b9
commit fd0e11fac0

View File

@ -97,7 +97,10 @@ export default class Pl3xmapMapProvider extends MapProvider {
this.worldMarkerUpdateIntervals.clear();
this.worldPlayerUpdateIntervals.clear();
(serverResponse.worlds || []).filter((w: any) => w && !!w.name).forEach((world: any, index: number) => {
const filteredWorlds = (serverResponse.worlds || []).filter((w: any) => w && !!w.name)
.sort((a: any, b: any) => a.order - b.order);
filteredWorlds.forEach((world: any, index: number) => {
const worldResponse = worldResponses[index],
worldConfig: {components: LiveAtlasPartialComponentConfig } = {
components: {},