Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashank999 committed Oct 27, 2023
2 parents c591669 + 914f650 commit 7361514
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extension/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -1465,9 +1465,10 @@ async function updateNPCs() {
async function fetchLootRangers() {
const data = await fetchData("lzpt", { section: "loot" });
const planned = data.time.clear;
const reason = data.time.reason;

npcs = {
next_update: now + TO_MILLIS.MINUTES * (planned === 0 ? 1 : 15),
next_update: now + TO_MILLIS.MINUTES * (planned === 0 && !reason ? 1 : 15),
service: "Loot Rangers",
targets: {},
};
Expand All @@ -1492,6 +1493,7 @@ async function updateNPCs() {
}

npcs.planned = planned === 0 ? false : planned * 1000;
npcs.reason = reason;

await ttStorage.set({ npcs });
return true;
Expand Down
2 changes: 2 additions & 0 deletions extension/scripts/features/npc-loot-times/ttNPCLootTimes.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
},
});
countdownTimers.push(timer);
} else if (npcs.reason) {
timer = document.newElement({ type: "span", class: "timer", text: `After ${npcs.reason}` });
} else {
timer = document.newElement({ type: "span", class: "timer", text: "Not Scheduled" });
}
Expand Down

0 comments on commit 7361514

Please sign in to comment.