Skip to content

Commit

Permalink
fix: update watchlist limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed Aug 15, 2024
1 parent 04aa834 commit f3ee662
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Controller/WatchListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public function putWatchList(WatchList $watchList): WatchList
$userWatchLists = $user->getWatchLists();

/** @var Domain[] $trackedDomains */
$trackedDomains = $userWatchLists->reduce(fn (array $acc, WatchList $watchList) => [...$acc, ...$watchList->getDomains()->toArray()], []);
$trackedDomains = $userWatchLists
->filter(fn (WatchList $wl) => $wl !== $watchList)
->reduce(fn (array $acc, WatchList $wl) => [...$acc, ...$wl->getDomains()->toArray()], []);

/** @var Domain $domain */
foreach ($watchList->getDomains()->getIterator() as $domain) {
Expand Down

0 comments on commit f3ee662

Please sign in to comment.