Skip to content

Commit cffe2e4

Browse files
committed
inbox [nfc]: Inline and unhoist a self-user lookup
This way we don't actually do the lookup unless we need it.
1 parent a7ecf5b commit cffe2e4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/widgets/inbox.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,10 @@ class _DmItem extends StatelessWidget {
382382
@override
383383
Widget build(BuildContext context) {
384384
final store = PerAccountStoreWidget.of(context);
385-
final selfUser = store.users[store.selfUserId]!;
386-
387385
final designVariables = DesignVariables.of(context);
388386

389387
final title = switch (narrow.otherRecipientIds) { // TODO dedupe with [RecentDmConversationsItem]
390-
[] => selfUser.fullName,
388+
[] => store.users[store.selfUserId]!.fullName,
391389
[var otherUserId] => store.userDisplayName(otherUserId),
392390

393391
// TODO(i18n): List formatting, like you can do in JavaScript:

0 commit comments

Comments
 (0)