Pending Zaps
A fairly large change that replaces Zaps in the codebase with "Zapping" which is a tagged union consisting of a resolved Zap and a Pending Zap. These are both counted as Zaps everywhere in Damus, except pending zaps can be cancelled (most of the time).
This commit is contained in:
@@ -9,17 +9,20 @@ import SwiftUI
|
||||
|
||||
struct ZapsView: View {
|
||||
let state: DamusState
|
||||
@StateObject var model: ZapsModel
|
||||
var model: ZapsModel
|
||||
|
||||
@ObservedObject var zaps: ZapsDataModel
|
||||
|
||||
init(state: DamusState, target: ZapTarget) {
|
||||
self.state = state
|
||||
self._model = StateObject(wrappedValue: ZapsModel(state: state, target: target))
|
||||
self.model = ZapsModel(state: state, target: target)
|
||||
self._zaps = ObservedObject(wrappedValue: state.events.get_cache_data(target.id).zaps_model)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
LazyVStack {
|
||||
ForEach(model.zaps, id: \.event.id) { zap in
|
||||
ForEach(zaps.zaps, id: \.request.id) { zap in
|
||||
ZapEvent(damus: state, zap: zap)
|
||||
.padding([.horizontal])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user