mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 02:02:19 +00:00
optimize world state api call
This commit is contained in:
parent
b713e10c14
commit
7d62c87de3
1 changed files with 4 additions and 3 deletions
|
|
@ -30,10 +30,11 @@ api.getWorldState = {
|
|||
const worldState = {};
|
||||
|
||||
worldState.worldBoss = await getWorldBoss();
|
||||
worldState.currentEvent = getCurrentEvent();
|
||||
worldState.npcImageSuffix = worldState.currentEvent ? worldState.currentEvent.npcImageSuffix : '';
|
||||
|
||||
worldState.currentEventList = getCurrentEventList();
|
||||
if (worldState.currentEventList.length > 0) {
|
||||
[worldState.currentEvent] = worldState.currentEventList;
|
||||
worldState.npcImageSuffix = worldState.currentEvent ? worldState.currentEvent.npcImageSuffix : '';
|
||||
}
|
||||
|
||||
res.respond(200, worldState);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue