notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 3f5264b4ab1a0cd4fe039bd6b38e5e78aefe7407
parent 83753ccc7d3969fc70844baaf8736f4f56ffdcb0
Author: kernelkind <kernelkind@gmail.com>
Date:   Fri, 17 Oct 2025 15:20:54 -0400

feat(action): add `NoteAction::React`

Signed-off-by: kernelkind <kernelkind@gmail.com>

Diffstat:
Mcrates/notedeck/src/note/action.rs | 3+++
Mcrates/notedeck_columns/src/actionbar.rs | 17++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/crates/notedeck/src/note/action.rs b/crates/notedeck/src/note/action.rs @@ -14,6 +14,9 @@ pub enum NoteAction { /// User has clicked the quote reply action Reply(NoteId), + /// User has clicked the like/reaction button + React(ReactAction), + /// User has clicked the repost button Repost(NoteId), diff --git a/crates/notedeck_columns/src/actionbar.rs b/crates/notedeck_columns/src/actionbar.rs @@ -16,7 +16,7 @@ use enostr::{FilledKeypair, NoteId, Pubkey, RelayPool}; use nostrdb::{IngestMetadata, Ndb, NoteBuilder, NoteKey, Transaction}; use notedeck::{ get_wallet_for, - note::{ReactAction, ZapTargetAmount}, + note::{reaction_sent_id, ReactAction, ZapTargetAmount}, Accounts, GlobalWallet, Images, NoteAction, NoteCache, NoteZapTargetOwned, UnknownIds, ZapAction, ZapTarget, ZappingError, Zaps, }; @@ -78,6 +78,21 @@ fn execute_note_action( router_action = Some(RouterAction::route_to(Route::accounts())); } } + NoteAction::React(react_action) => { + if let Some(filled) = accounts.selected_filled() { + if let Err(err) = send_reaction_event(ndb, txn, pool, filled, &react_action) { + tracing::error!("Failed to send reaction: {err}"); + } + ui.ctx().data_mut(|d| { + d.insert_temp( + reaction_sent_id(filled.pubkey, react_action.note_id.bytes()), + true, + ) + }); + } else { + router_action = Some(RouterAction::route_to(Route::accounts())); + } + } NoteAction::Profile(pubkey) => { let kind = TimelineKind::Profile(pubkey); router_action = Some(RouterAction::route_to(Route::Timeline(kind.clone())));