diff --git a/src/Controller/WatchListController.php b/src/Controller/WatchListController.php index 9ce9296..c1d07a2 100644 --- a/src/Controller/WatchListController.php +++ b/src/Controller/WatchListController.php @@ -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) {