key AuthorController on only what it needs
This commit is contained in:
parent
89f395cede
commit
06306d31a7
3 changed files with 34 additions and 12 deletions
|
|
@ -13,7 +13,7 @@ class const MessageAvatar(
|
|||
}) extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) =>
|
||||
switch (ref.watch(AuthorController.provider(event))) {
|
||||
switch (ref.watch(AuthorController.provider(.fromEvent(event)))) {
|
||||
AsyncData(:final value) || AsyncLoading(:final value?) => InkWell(
|
||||
onTap: () =>
|
||||
context.showUserPopover(event.sender, roomId: event.roomId),
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class const MessageDisplayname(
|
|||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final color = ref.displaynameColor(event.roomId, event.sender);
|
||||
|
||||
return switch (ref.watch(AuthorController.provider(event))) {
|
||||
return switch (ref.watch(AuthorController.provider(.fromEvent(event)))) {
|
||||
AsyncData(:final MembershipContent? value) ||
|
||||
AsyncLoading(:final value) ||
|
||||
AsyncError(:final value) => InkWell(
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class UserSpan(
|
|||
|
||||
return UserSpan(
|
||||
context,
|
||||
ref.watch(AuthorController.provider(event)).value?.displayName ??
|
||||
ref.watch(AuthorController.provider(.fromEvent(event))).value?.displayName ??
|
||||
event.sender.localpart,
|
||||
userId: event.sender,
|
||||
roomId: event.roomId,
|
||||
|
|
|
|||
Loading…
Reference in a new issue