Exclude unresolvable tickets

Ticket's Matrix rooms could be missing for whatever reason. Errors are still logged.
This commit is contained in:
Ben 2022-07-21 13:39:24 +02:00
parent 6f855e22c4
commit b3619d3ae1
Signed by: ben
GPG Key ID: 0F54A7ED232D3319
2 changed files with 6 additions and 2 deletions

View File

@ -50,7 +50,11 @@ class TicketService {
public function findAll(string $userId): array {
$dbTickets = $this->ticketMapper->findAllForUser($this->getOrCreateUser($userId));
return array_map(function ($ticket) { return $this->resolveTicket($ticket); }, $dbTickets);
return array_filter(array_map(function ($ticket) {
return $this->resolveTicket($ticket);
}, $dbTickets), function ($resolvedTicket) {
return $resolvedTicket['status'] !== "error";
});
}
/**

View File

@ -56,7 +56,7 @@ export default {
elementWebFrame.src = 'about:blank'
elementWebFrame.onload = function() {
const textElement = elementWebFrame.contentDocument.createElement('strong')
textElement.innerText = 'Textchat nicht verfügbar. Es ist noch kein Helfer zugewiesen.'
textElement.innerText = 'Textchat nicht verfügbar. Es ist noch kein(e) Helfer*in zugewiesen.'
elementWebFrame.contentDocument.body.appendChild(textElement)
elementWebFrame.onload = undefined
}