mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-24 03:24:21 +01:00
note: remove unnecessary derive macros from NoteAction
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@ use super::context::ContextSelection;
|
|||||||
use crate::zaps::NoteZapTargetOwned;
|
use crate::zaps::NoteZapTargetOwned;
|
||||||
use enostr::{NoteId, Pubkey};
|
use enostr::{NoteId, Pubkey};
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq, Clone)]
|
#[derive(Debug)]
|
||||||
pub enum NoteAction {
|
pub enum NoteAction {
|
||||||
/// User has clicked the quote reply action
|
/// User has clicked the quote reply action
|
||||||
Reply(NoteId),
|
Reply(NoteId),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ pub struct DaveUi<'a> {
|
|||||||
|
|
||||||
/// The response the app generates. The response contains an optional
|
/// The response the app generates. The response contains an optional
|
||||||
/// action to take.
|
/// action to take.
|
||||||
#[derive(Default, Clone, Debug)]
|
#[derive(Default, Debug)]
|
||||||
pub struct DaveResponse {
|
pub struct DaveResponse {
|
||||||
pub action: Option<DaveAction>,
|
pub action: Option<DaveAction>,
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ impl DaveResponse {
|
|||||||
/// The actions the app generates. No default action is specfied in the
|
/// The actions the app generates. No default action is specfied in the
|
||||||
/// UI code. This is handled by the app logic, however it chooses to
|
/// UI code. This is handled by the app logic, however it chooses to
|
||||||
/// process this message.
|
/// process this message.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Debug)]
|
||||||
pub enum DaveAction {
|
pub enum DaveAction {
|
||||||
/// The action generated when the user sends a message to dave
|
/// The action generated when the user sends a message to dave
|
||||||
Send,
|
Send,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ pub struct NoteContents<'a, 'd> {
|
|||||||
txn: &'a Transaction,
|
txn: &'a Transaction,
|
||||||
note: &'a Note<'a>,
|
note: &'a Note<'a>,
|
||||||
options: NoteOptions,
|
options: NoteOptions,
|
||||||
action: Option<NoteAction>,
|
pub action: Option<NoteAction>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'd> NoteContents<'a, 'd> {
|
impl<'a, 'd> NoteContents<'a, 'd> {
|
||||||
@@ -38,10 +38,6 @@ impl<'a, 'd> NoteContents<'a, 'd> {
|
|||||||
action: None,
|
action: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn action(&self) -> &Option<NoteAction> {
|
|
||||||
&self.action
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl egui::Widget for &mut NoteContents<'_, '_> {
|
impl egui::Widget for &mut NoteContents<'_, '_> {
|
||||||
|
|||||||
@@ -442,8 +442,8 @@ impl<'a, 'd> NoteView<'a, 'd> {
|
|||||||
|
|
||||||
ui.add(&mut contents);
|
ui.add(&mut contents);
|
||||||
|
|
||||||
if let Some(action) = contents.action() {
|
if let Some(action) = contents.action {
|
||||||
note_action = Some(action.clone());
|
note_action = Some(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.options().has_actionbar() {
|
if self.options().has_actionbar() {
|
||||||
@@ -506,8 +506,8 @@ impl<'a, 'd> NoteView<'a, 'd> {
|
|||||||
);
|
);
|
||||||
ui.add(&mut contents);
|
ui.add(&mut contents);
|
||||||
|
|
||||||
if let Some(action) = contents.action() {
|
if let Some(action) = contents.action {
|
||||||
note_action = Some(action.clone());
|
note_action = Some(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.options().has_actionbar() {
|
if self.options().has_actionbar() {
|
||||||
|
|||||||
Reference in New Issue
Block a user