mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 08:21:47 +00:00
Fix 'annotate' state of draft
This commit is contained in:
parent
d4e892b30c
commit
3cd58b6897
@ -754,7 +754,6 @@ pub fn render_note_inner(
|
||||
if let Some(channel) =
|
||||
DmChannel::from_event(¬e.event, None)
|
||||
{
|
||||
app.draft_is_annotate = false;
|
||||
app.draft_needs_focus = true;
|
||||
app.show_post_area = true;
|
||||
|
||||
@ -774,7 +773,6 @@ pub fn render_note_inner(
|
||||
.on_hover_text("Reply")
|
||||
.clicked()
|
||||
{
|
||||
app.draft_is_annotate = false;
|
||||
app.draft_needs_focus = true;
|
||||
app.show_post_area = true;
|
||||
|
||||
@ -1389,10 +1387,10 @@ fn note_actions(
|
||||
my_items.push(MoreMenuItem::Button(MoreMenuButton::new(
|
||||
"Annotate",
|
||||
Box::new(|_ui, app| {
|
||||
app.draft_is_annotate = true;
|
||||
app.draft_needs_focus = true;
|
||||
app.show_post_area = true;
|
||||
|
||||
app.draft_data.is_annotate = true;
|
||||
app.draft_data.replying_to = Some(note.event.id)
|
||||
}),
|
||||
)));
|
||||
|
@ -369,7 +369,7 @@ fn dm_posting_area(
|
||||
content: app.dm_draft_data.draft.clone(),
|
||||
tags,
|
||||
in_reply_to: None,
|
||||
annotation: app.draft_is_annotate,
|
||||
annotation: app.dm_draft_data.is_annotate,
|
||||
dm_channel: Some(dm_channel.to_owned()),
|
||||
});
|
||||
|
||||
@ -414,7 +414,7 @@ fn real_posting_area(app: &mut GossipUi, ctx: &Context, ui: &mut Ui) {
|
||||
.max_height(window_height * 0.7)
|
||||
.show(ui, |ui| {
|
||||
if let Some(id) = app.draft_data.replying_to.or(app.draft_data.repost) {
|
||||
let msg = if app.draft_is_annotate {
|
||||
let msg = if app.draft_data.is_annotate {
|
||||
"Annotating:"
|
||||
} else {
|
||||
"Replying to:"
|
||||
@ -720,7 +720,7 @@ fn real_posting_area(app: &mut GossipUi, ctx: &Context, ui: &mut Ui) {
|
||||
content: replaced,
|
||||
tags,
|
||||
in_reply_to: Some(replying_to_id),
|
||||
annotation: app.draft_is_annotate,
|
||||
annotation: app.draft_data.is_annotate,
|
||||
dm_channel: None,
|
||||
});
|
||||
}
|
||||
@ -734,7 +734,7 @@ fn real_posting_area(app: &mut GossipUi, ctx: &Context, ui: &mut Ui) {
|
||||
content: replaced,
|
||||
tags,
|
||||
in_reply_to: None,
|
||||
annotation: app.draft_is_annotate,
|
||||
annotation: app.draft_data.is_annotate,
|
||||
dm_channel: None,
|
||||
});
|
||||
}
|
||||
|
@ -336,6 +336,9 @@ pub struct DraftData {
|
||||
pub tagging_search_selected: Option<usize>,
|
||||
pub tagging_search_searched: Option<String>,
|
||||
pub tagging_search_results: Vec<(String, PublicKey)>,
|
||||
|
||||
// If this is an annotation
|
||||
pub is_annotate: bool,
|
||||
}
|
||||
|
||||
impl Default for DraftData {
|
||||
@ -360,6 +363,8 @@ impl Default for DraftData {
|
||||
tagging_search_selected: None,
|
||||
tagging_search_searched: None,
|
||||
tagging_search_results: Vec::new(),
|
||||
|
||||
is_annotate: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -382,6 +387,7 @@ impl DraftData {
|
||||
self.tagging_search_selected = None;
|
||||
self.tagging_search_searched = None;
|
||||
self.tagging_search_results.clear();
|
||||
self.is_annotate = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -469,7 +475,6 @@ struct GossipUi {
|
||||
unlock_needs_focus: bool,
|
||||
draft_data: DraftData,
|
||||
dm_draft_data: DraftData,
|
||||
draft_is_annotate: bool,
|
||||
|
||||
// User entry: metadata
|
||||
editing_metadata: bool,
|
||||
@ -719,7 +724,6 @@ impl GossipUi {
|
||||
unlock_needs_focus: true,
|
||||
draft_data: DraftData::default(),
|
||||
dm_draft_data: DraftData::default(),
|
||||
draft_is_annotate: false,
|
||||
editing_metadata: false,
|
||||
metadata: Metadata::new(),
|
||||
delegatee_tag_str: "".to_owned(),
|
||||
|
Loading…
Reference in New Issue
Block a user