Skip to content

Commit

Permalink
Fix: getting loader in each month expense section
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-nirali-s committed Dec 17, 2024
1 parent 990afe6 commit 430dc21
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Splito/UI/Home/Groups/Group/GroupExpenseListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,16 @@ struct GroupExpenseListView: View {
viewModel.manageScrollToTopBtnVisibility(true)
}
}

if expense.expense.id == viewModel.groupExpenses[month]?.last?.expense.id && viewModel.hasMoreExpenses {
ProgressView()
.frame(maxWidth: .infinity, alignment: .center)
.onAppear {
viewModel.loadMoreExpenses()
}.padding(.vertical, 8)
}
}
}
}

if viewModel.hasMoreExpenses {
ProgressView()
.frame(maxWidth: .infinity, alignment: .center)
.onAppear(perform: viewModel.loadMoreExpenses)
.padding(.vertical, 8)
}
} else if viewModel.groupExpenses.isEmpty && viewModel.showSearchBar {
ExpenseNotFoundView(geometry: geometry, searchedExpense: viewModel.searchedExpense)
}
Expand Down

0 comments on commit 430dc21

Please sign in to comment.