ensure activeSessions is an array
sometimes the resulting json contained an object leading to JS errors Signed-off-by: chandi Langecker <git@chandi.it>
This commit is contained in:
@@ -457,9 +457,13 @@ class BoardService {
|
|||||||
public function enrichWithActiveSessions(Board $board) {
|
public function enrichWithActiveSessions(Board $board) {
|
||||||
$sessions = $this->sessionMapper->findAllActive($board->getId());
|
$sessions = $this->sessionMapper->findAllActive($board->getId());
|
||||||
|
|
||||||
$board->setActiveSessions(array_unique(array_map(function (Session $session) {
|
$board->setActiveSessions(array_values(
|
||||||
return $session->getUserId();
|
array_unique(
|
||||||
}, $sessions)));
|
array_map(function (Session $session) {
|
||||||
|
return $session->getUserId();
|
||||||
|
}, $sessions)
|
||||||
|
)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user