better target for message notifications
Some checks failed
linter / quality (push) Failing after 1m4s
tests / ci (8.3) (push) Failing after 48s
tests / ci (8.4) (push) Failing after 1m3s
tests / ci (8.5) (push) Failing after 1m10s

This commit is contained in:
Daan Meijer 2026-06-22 13:55:38 +02:00
parent 10bd46a53e
commit f3d5be6a80
4 changed files with 10 additions and 4 deletions

View File

@ -62,7 +62,7 @@ class DynamicController extends Controller
'dynamic' => new DynamicResource($dynamic), 'dynamic' => new DynamicResource($dynamic),
'ledgers' => LedgerResource::collection($dynamic->ledgers), 'ledgers' => LedgerResource::collection($dynamic->ledgers),
'participants' => UserResource::collection($dynamic->participants), 'participants' => UserResource::collection($dynamic->participants),
'messages' => MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(20)), 'messages' => MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(10)),
'can' => [ 'can' => [
'update' => $request->user()->can('update', $dynamic), 'update' => $request->user()->can('update', $dynamic),
], ],
@ -73,7 +73,7 @@ class DynamicController extends Controller
{ {
$this->authorize('view', $dynamic); $this->authorize('view', $dynamic);
return MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(20)); return MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(10));
} }
/** /**

View File

@ -87,7 +87,7 @@ class LedgerController extends Controller
'ledger' => new LedgerResource($ledger), 'ledger' => new LedgerResource($ledger),
'mutations' => MutationResource::collection($ledger->mutations), 'mutations' => MutationResource::collection($ledger->mutations),
'participants' => UserResource::collection($dynamic->participants), 'participants' => UserResource::collection($dynamic->participants),
'messages' => MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(20)), 'messages' => MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(10)),
'can' => [ 'can' => [
'update' => $request->user()->can('update', $ledger), 'update' => $request->user()->can('update', $ledger),
'close' => $request->user()->can('close', $ledger), 'close' => $request->user()->can('close', $ledger),
@ -99,7 +99,7 @@ class LedgerController extends Controller
{ {
$this->authorize('view', $ledger); $this->authorize('view', $ledger);
return MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(20)); return MessageResource::collection($dynamic->chat->messages()->with(['user', 'media'])->latest()->paginate(10));
} }
/** /**

View File

@ -177,6 +177,11 @@ class ActivityService
return route('dynamics.ledgers.show', [$entity->dynamic->uuid, $entity->uuid]); return route('dynamics.ledgers.show', [$entity->dynamic->uuid, $entity->uuid]);
} }
if ($entity instanceof Message) {
$subject = $entity->subject;
return $this->getUrlForEntity($subject);
}
return ''; return '';
} }

View File

@ -104,6 +104,7 @@ function formatTimestamp(isoString: string): { full: string; time: string } {
const participantsById = computed(() => { const participantsById = computed(() => {
const list = props.participants || []; const list = props.participants || [];
return list.reduce( return list.reduce(
(acc, p) => { (acc, p) => {
acc[p.id] = p; acc[p.id] = p;