Rework usage of filter() into some()

This commit is contained in:
Dev 2023-08-07 11:17:46 +01:00
parent 92c30dbe5d
commit 74f7ee8e77

View File

@ -220,11 +220,11 @@ export class ProfileFixerService
{
if (pmcProfile.RepeatableQuests && activeQuests.length > 0)
{
const matchingQuest = activeQuests.filter(x => x._id === backendCounter.qid);
const quest = pmcProfile.Quests.filter(q => q.qid === backendCounter.qid);
const existsInActiveRepeatableQuests = activeQuests.some(x => x._id === backendCounter.qid);
const existsInQuests = pmcProfile.Quests.some(q => q.qid === backendCounter.qid);
// if BackendCounter's quest is neither in activeQuests nor Quests it's stale
if (matchingQuest.length === 0 && quest.length === 0)
if (existsInActiveRepeatableQuests && existsInQuests)
{
counterKeysToRemove.push(key);
}