Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ final class CoinJoinWithdrawalStore {
return loaded().contains(txid)
}

/// Every recorded sweep txid (WIRE order) for the active wallet. Thread-safe.
/// The home feed uses this to build the combined "CoinJoin Withdrawals"
/// group from point lookups instead of scanning the whole history for the
/// tagged rows.
func allTxids() -> Set<Data> {
lock.lock(); defer { lock.unlock() }
return loaded()
}

/// Clear a SINGLE wallet's recorded sweep txids (used by the per-wallet
/// Remove flow — the removed wallet may not be the active one, so address it
/// by explicit `walletIdHex`). Thread-safe. Invalidates the in-memory cache
Expand Down
38 changes: 34 additions & 4 deletions DashWallet/Sources/UI/Home/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,16 @@ struct HomeViewContent<Content: View>: View {
// reload is still running, so show progress rather than
// telling the user they have no transactions.
if viewModel.hasLoadedInitialTxItems {
Text(NSLocalizedString("There are no transactions to display", comment: ""))
.font(.caption)
.foregroundColor(Color.primary.opacity(0.5))
.padding(.top, 20)
// With unloaded history remaining, an empty window
// (e.g. a filter matching nothing loaded yet) is
// not "no transactions" — the tail sentinel below
// renders and keeps paging instead.
if !viewModel.canLoadMoreHistory {
Text(NSLocalizedString("There are no transactions to display", comment: ""))
.font(.caption)
.foregroundColor(Color.primary.opacity(0.5))
.padding(.top, 20)
}
} else {
HStack(spacing: 10) {
SwiftUI.ProgressView()
Expand Down Expand Up @@ -396,6 +402,30 @@ struct HomeViewContent<Content: View>: View {
}
}
}

// Tail sentinel: reaching it pages the next day-completed
// slice of history in. Its identity is keyed on the page
// stamp so `onAppear` re-fires while it stays visible
// (auto-continues when a page adds no visible rows under
// the active filter). Outside the empty/non-empty branch
// on purpose: a filter can hide every loaded row, and the
// empty state must still be able to page deeper.
if viewModel.canLoadMoreHistory {
HStack(spacing: 10) {
SwiftUI.ProgressView()
.progressViewStyle(CircularProgressViewStyle())

Text(NSLocalizedString("Loading more transactions", comment: "Home"))
.font(.caption)
.foregroundColor(Color.primary.opacity(0.5))
}
.frame(maxWidth: .infinity)
.padding(.vertical, 16)
.id(viewModel.historyPageStamp)
.onAppear {
viewModel.loadMoreHistory()
}
}
}
.padding(EdgeInsets(top: -20, leading: 0, bottom: 0, trailing: 0))
// Scroll sentinel as a background so it adds no layout
Expand Down
Loading
Loading