Merge #464: fix: home list events filter

b89eee30dfee77f357463ccc5d16ceeed705ff43 fix: home list events filter (edouard)

Pull request description:

  We still list the self-send transactions but
  we do not display them, because they are required
  in order to have the next timestamp for the pagination. This commit fix a misplaced filter that mixed up
  events index for the event selection.

  close #463

ACKs for top commit:
  edouardparis:
    Self-ACK b89eee30dfee77f357463ccc5d16ceeed705ff43

Tree-SHA512: 9c004c3d9a4e805781c113052d59758f1673679e18c2cc9fc7b09178be6316a8966f3d18d67b557ada1b7f5669c8550ddbfff34a6723c8158cdead3f6b7cfe20
This commit is contained in:
edouard 2023-04-24 10:56:48 +02:00
commit 4613da4ae4
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F

View File

@ -86,23 +86,26 @@ pub fn home_view<'a>(
Column::new()
.spacing(10)
.push(h4_bold("Last payments"))
.push(
pending_events
.iter()
.enumerate()
.fold(Column::new().spacing(10), |col, (i, event)| {
.push(pending_events.iter().enumerate().fold(
Column::new().spacing(10),
|col, (i, event)| {
if !event.is_self_send() {
col.push(event_list_view(i, event))
}),
)
.push(
events
.iter()
.filter(|event| !event.is_self_send())
.enumerate()
.fold(Column::new().spacing(10), |col, (i, event)| {
} else {
col
}
},
))
.push(events.iter().enumerate().fold(
Column::new().spacing(10),
|col, (i, event)| {
if !event.is_self_send() {
col.push(event_list_view(i + pending_events.len(), event))
}),
)
} else {
col
}
},
))
.push_maybe(
if events.len() % HISTORY_EVENT_PAGE_SIZE as usize == 0 && !events.is_empty() {
Some(