From d269d19cd425d37234bd24fb4611c951ec772cd1 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 1 May 2021 18:18:54 +0200 Subject: Fixed frontend to work with new model --- derelict.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/derelict.js b/derelict.js index f1227c1..53358d6 100644 --- a/derelict.js +++ b/derelict.js @@ -73,7 +73,8 @@ class Wreck { const iconElement = document.importNode(icon, true) const labelElement = document.createElement('div') const object2d = new CSS2DObject(this.domElement) - const team = killmail.team > 1 ? "teamA" : "teamB" + const ownerId = "alliance_id" in killmail.victim ? killmail.victim.alliance_id : killmail.victim.corporation_id + const team = killmail.teams.findIndex(team => undefined !== team.find(id => id == ownerId)) == 0 ? "teamA" : "teamB" const shipTypeId = killmail.victim.ship_type_id fetch(`${ESI}/universe/types/${shipTypeId}/`, {cache: "force-cache"}) @@ -229,8 +230,8 @@ function init() { const url = km => `${ESI}/killmails/${km.id}/${km.hash}/?datasource=tranquility` const retrieve = km => fetch(url(km)) .then(response => response.json()) - .then(data => { data.team = km.team; return data }) - return Promise.all(killmails.map(retrieve)) + .then(data => { data.teams = killmails.teams; return data }) + return Promise.all(killmails.killmails.map(retrieve)) }) .then(killmails => { icon.then(icon => processKillmails({skybox, renderer, renderer2d, container}, killmails, icon)) -- cgit v1.1