Skip to content

Commit 0ce94c4

Browse files
committed
analyze: Fix new lint on latest Flutter main
`flutter analyze` has started giving the following, which breaks CI: info • Unnecessary comparison to a boolean literal • lib/api/model/events.dart:1177:10 • no_literal_bool_comparisons info • Unnecessary comparison to a boolean literal • lib/model/channel.dart:158:13 • no_literal_bool_comparisons We fixed the first one in the previous commit; this fixes the second. See discussion: https://chat.zulip.org/#narrow/channel/243-mobile-team/topic/CI.20on.20latest.20upstream/near/2228858
1 parent 8c3b505 commit 0ce94c4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/model/channel.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ mixin ChannelStore on UserStore {
153153
case ChannelPostPolicy.any: return true;
154154
case ChannelPostPolicy.fullMembers: {
155155
if (!role.isAtLeast(UserRole.member)) return false;
156-
return role == UserRole.member
157-
? hasPassedWaitingPeriod(user, byDate: byDate)
158-
: true;
156+
if (role == UserRole.member) {
157+
return hasPassedWaitingPeriod(user, byDate: byDate);
158+
}
159+
return true;
159160
}
160161
case ChannelPostPolicy.moderators: return role.isAtLeast(UserRole.moderator);
161162
case ChannelPostPolicy.administrators: return role.isAtLeast(UserRole.administrator);

0 commit comments

Comments
 (0)