🐛 Fix dm channel display error with deleted user
This commit is contained in:
parent
ad4e4071fa
commit
8d79274b0c
@ -201,9 +201,10 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
|||||||
String title = _channel?.name ?? 'loading'.tr;
|
String title = _channel?.name ?? 'loading'.tr;
|
||||||
String? placeholder;
|
String? placeholder;
|
||||||
|
|
||||||
if (_channel?.type == 1) {
|
|
||||||
final otherside =
|
final otherside =
|
||||||
_channel!.members!.where((e) => e.account.id != _accountId).first;
|
_channel!.members!.where((e) => e.account.id != _accountId).firstOrNull;
|
||||||
|
|
||||||
|
if (_channel?.type == 1 && otherside != null) {
|
||||||
title = otherside.account.nick;
|
title = otherside.account.nick;
|
||||||
placeholder = 'messageInputPlaceholder'.trParams(
|
placeholder = 'messageInputPlaceholder'.trParams(
|
||||||
{'channel': '@${otherside.account.name}'},
|
{'channel': '@${otherside.account.name}'},
|
||||||
|
@ -132,10 +132,10 @@ class _ChannelListWidgetState extends State<ChannelListWidget> {
|
|||||||
? const EdgeInsets.symmetric(horizontal: 20)
|
? const EdgeInsets.symmetric(horizontal: 20)
|
||||||
: const EdgeInsets.symmetric(horizontal: 16);
|
: const EdgeInsets.symmetric(horizontal: 16);
|
||||||
|
|
||||||
if (item.type == 1) {
|
|
||||||
final otherside =
|
final otherside =
|
||||||
item.members!.where((e) => e.account.id != widget.selfId).first;
|
item.members!.where((e) => e.account.id != widget.selfId).firstOrNull;
|
||||||
|
|
||||||
|
if (item.type == 1 && otherside != null) {
|
||||||
final avatar = AccountAvatar(
|
final avatar = AccountAvatar(
|
||||||
content: otherside.account.avatar,
|
content: otherside.account.avatar,
|
||||||
radius: widget.isDense ? 12 : 20,
|
radius: widget.isDense ? 12 : 20,
|
||||||
|
Loading…
Reference in New Issue
Block a user