Skip to content

Commit

Permalink
[5.x] Fix addon events dispatched twice if registered manually (#11049)
Browse files Browse the repository at this point in the history
  • Loading branch information
morhi authored Nov 4, 2024
1 parent 495a3d9 commit ba04ca4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Providers/AddonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ private function getEventListeners()

foreach ($this->listen as $event => $listeners) {
foreach ($listeners as $listener) {
$arr[$event][] = $listener;
if (! in_array($listener, $arr[$event] ?? [])) {
$arr[$event][] = $listener;
}
}
}

Expand Down

0 comments on commit ba04ca4

Please sign in to comment.