You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Revolt/Pages/Home/CreateGroup.swift
+12-15Lines changed: 12 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -16,20 +16,7 @@ struct CreateGroup: View {
16
16
@StatevarselectedUsers:Set<User>=Set()
17
17
@Statevarerror:String?=nil
18
18
19
-
func getFriends()->[User]{
20
-
varfriends:[User]=[]
21
-
22
-
foruserin viewState.users.values {
23
-
switch user.relationship ??.None {
24
-
case.Friend:
25
-
friends.append(user)
26
-
default:
27
-
()
28
-
}
29
-
}
30
-
31
-
return friends
32
-
}
19
+
@StatevarallFriends:[User]=[]
33
20
34
21
varbody:someView{
35
22
VStack(spacing:4){
@@ -46,7 +33,7 @@ struct CreateGroup: View {
46
33
.padding([.horizontal,.top],16)
47
34
48
35
List(selection: $selectedUsers){
49
-
ForEach(getFriends().filter{ user in searchText.isEmpty || (user.username.contains(searchText) || (user.display_name?.contains(searchText)??false))}){ user in
36
+
ForEach(allFriends.filter{ user in searchText.isEmpty || (user.username.contains(searchText) || (user.display_name?.contains(searchText)??false))}){ user in
0 commit comments