Skip to content

Commit 389960a

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/search-for-logs'
2 parents 86d6da2 + a10ef8b commit 389960a

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

Splito/UI/Home/Groups/GroupListViewModel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ class GroupListViewModel: BaseViewModel, ObservableObject {
103103
}
104104
}
105105

106-
func fetchGroupsInitialData(needToReload: Bool = false) {
106+
func fetchGroupsInitialData() {
107107
lastDocument = nil
108108
Task { [weak self] in
109-
await self?.fetchGroups(needToReload: needToReload)
109+
await self?.fetchGroups()
110110
}
111111
}
112112

@@ -157,7 +157,7 @@ class GroupListViewModel: BaseViewModel, ObservableObject {
157157
}
158158
}
159159

160-
private func fetchGroups(needToReload: Bool = false) async {
160+
private func fetchGroups() async {
161161
guard let userId = preference.user?.id else {
162162
currentViewState = .initial
163163
return

Splito/UI/Home/Groups/GroupListWithDetailView.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ struct GroupListWithDetailView: View {
4141

4242
if group.group.id == viewModel.filteredGroups.last?.group.id && viewModel.hasMoreGroups {
4343
ProgressView()
44-
.onAppear {
45-
viewModel.loadMoreGroups()
46-
}
44+
.onAppear { viewModel.loadMoreGroups() }
4745
}
4846
}
4947

@@ -57,6 +55,8 @@ struct GroupListWithDetailView: View {
5755
perform: viewModel.manageScrollToTopBtnVisibility(offset:))
5856
})
5957
}
58+
.scrollBounceBehavior(.basedOnSize)
59+
.refreshable { viewModel.fetchGroupsInitialData() }
6060
.overlay(alignment: .bottomTrailing) {
6161
if viewModel.showScrollToTopBtn {
6262
ScrollToTopButton {
@@ -65,10 +65,6 @@ struct GroupListWithDetailView: View {
6565
.padding([.trailing, .bottom], 16)
6666
}
6767
}
68-
.scrollBounceBehavior(.basedOnSize)
69-
.refreshable {
70-
viewModel.fetchGroupsInitialData(needToReload: true)
71-
}
7268
}
7369
}
7470
.onTapGesture {

0 commit comments

Comments
 (0)