Skip to content

Commit e0b729d

Browse files
committed
wip group use _selfInGroup in selfInGroupSetting
1 parent 57b4b14 commit e0b729d

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/model/user_group.dart

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,7 @@ class UserGroupStoreImpl extends PerAccountStoreBase with UserGroupStore {
113113
};
114114
}
115115

116-
bool _selfInGroup(int groupId) {
117-
final group = _groups[groupId];
118-
if (group == null) return false; // TODO(log); should know all groups
119-
// TODO(perf), TODO(#814): memoize which groups the self-user is in,
120-
// to save doing this depth-first search on each permission check
121-
return group.members.contains(selfUserId)
122-
|| group.directSubgroupIds.any(_selfInGroup);
123-
}
116+
bool _selfInGroup(int groupId) => _selfUserGroups.contains(groupId);
124117

125118
/// All the (named) user groups in the realm.
126119
///

0 commit comments

Comments
 (0)