Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanStepanok committed Sep 15, 2023
1 parent e9a06a9 commit bb6c4a0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions Discovery/Discovery/Presentation/DiscoveryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ public struct DiscoveryView: View {
OfflineSnackBarView(
connectivity: viewModel.connectivity,
reloadAction: {
viewModel.courses = []
viewModel.totalPages = 1
viewModel.nextPage = 1
await viewModel.discovery(page: 1, withProgress: false)
})

Expand Down
2 changes: 2 additions & 0 deletions Discovery/Discovery/Presentation/DiscoveryViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public class DiscoveryViewModel: ObservableObject {
if connectivity.isInternetAvaliable {
if page == 1 {
await courses = try interactor.discovery(page: page)
self.totalPages = 1
self.nextPage = 1
} else {
await courses += try interactor.discovery(page: page)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public struct ThreadView: View {
viewModel.sendUpdateUnreadState()
}
} onRefresh: {
// viewModel.comments = []
Task {
_ = await viewModel.getPosts(thread: thread, page: 1)
}
Expand Down

0 comments on commit bb6c4a0

Please sign in to comment.