Skip to content

Commit

Permalink
feat: support multi-baro (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno authored Sep 28, 2023
1 parent 18bc608 commit aeb057a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/notifications/worldstate/Notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ const buildNotifiableData = (newData, notified) => {
newData.archonHunt && !newData.archonHunt.expired && !notified.includes(newData.archonHunt.id)
? newData.archonHunt
: undefined,
baro:
newData.voidTrader && !notified.includes(`${newData.voidTrader.id}${newData.voidTrader.active ? '1' : '0'}`)
? newData.voidTrader
baros:
newData.voidTraders?.length &&
newData.voidTraders?.filter((vt) => !notified.includes(`${vt.id}${vt.active ? '1' : '0'}`))?.length
? newData.voidTraders?.filter((vt) => !notified.includes(`${vt.id}${vt.active ? '1' : '0'}`))
: undefined,
conclave: newData.conclaveChallenges.filter((cc) => !cc.expired && !cc.rootChallenge && !notified.includes(cc.id)),
dailyDeals: newData.dailyDeals.filter((dd) => !notified.includes(dd.id)),
Expand Down Expand Up @@ -150,7 +151,7 @@ export default class Notifier {
acolytes,
sortie,
syndicateM,
baro,
baros,
tweets,
nightwave,
featuredDeals,
Expand All @@ -174,9 +175,12 @@ export default class Notifier {

await this.#sendAcolytes(acolytes, deps);

// if (baro) {
// await this.#sendBaro(baro, deps);
// }
if (baros?.length) {
// eslint-disable-next-line no-restricted-syntax
for await (const baro of baros) {
await this.#sendBaro(baro, deps);
}
}
if (conclave && conclave.length > 0) {
await this.#sendConclaveDailies(conclave, deps);
await this.#sendConclaveWeeklies(conclave, deps);
Expand Down

0 comments on commit aeb057a

Please sign in to comment.