Skip to content

Commit

Permalink
Fix reaction and repost index
Browse files Browse the repository at this point in the history
  • Loading branch information
akiomik committed Jan 9, 2024
1 parent 63551c9 commit 1a0bef7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/components/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,15 @@ impl<'a> Component for Home<'a> {
self.list_state.selected(),
&self.command_tx,
) {
let event = self.notes.get(i).expect("failed to get target event");
let event = self
.sorted_notes()
.get(i)
.expect("failed to get target event")
.0
.event
.clone();
let content = event.content.clone();
log::info!("Send Reaction: {i}, {content}");
tx.send(Action::SendReaction((event.id, event.pubkey)))?;
}
}
Expand All @@ -187,7 +195,13 @@ impl<'a> Component for Home<'a> {
self.list_state.selected(),
&self.command_tx,
) {
let event = self.notes.get(i).expect("failed to get target event");
let event = self
.sorted_notes()
.get(i)
.expect("failed to get target event")
.0
.event
.clone();
tx.send(Action::SendRepost((event.id, event.pubkey)))?;
}
}
Expand Down

0 comments on commit 1a0bef7

Please sign in to comment.