File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1419,23 +1419,25 @@ class _ComposeBoxState extends State<ComposeBox> with PerAccountStoreAwareStateM
1419
1419
1420
1420
Widget ? _errorBanner (BuildContext context) {
1421
1421
final store = PerAccountStoreWidget .of (context);
1422
- final selfUser = store.users[store.selfUserId]! ;
1423
1422
switch (widget.narrow) {
1424
1423
case ChannelNarrow (: final streamId):
1425
1424
case TopicNarrow (: final streamId):
1426
1425
final channel = store.streams[streamId];
1426
+ final selfUser = store.users[store.selfUserId]! ;
1427
1427
if (channel == null || ! store.hasPostingPermission (inChannel: channel,
1428
1428
user: selfUser, byDate: DateTime .now ())) {
1429
1429
return _ErrorBanner (label:
1430
1430
ZulipLocalizations .of (context).errorBannerCannotPostInChannelLabel);
1431
1431
}
1432
+
1432
1433
case DmNarrow (: final otherRecipientIds):
1433
1434
final hasDeactivatedUser = otherRecipientIds.any ((id) =>
1434
1435
! (store.users[id]? .isActive ?? true ));
1435
1436
if (hasDeactivatedUser) {
1436
1437
return _ErrorBanner (label:
1437
1438
ZulipLocalizations .of (context).errorBannerDeactivatedDmLabel);
1438
1439
}
1440
+
1439
1441
case CombinedFeedNarrow ():
1440
1442
case MentionsNarrow ():
1441
1443
case StarredMessagesNarrow ():
You can’t perform that action at this time.
0 commit comments