mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 03:33:53 +00:00
Some ui fixes around warning conditions about identity not setup
This commit is contained in:
parent
1fbca5fc93
commit
234df5b47e
@ -129,7 +129,6 @@ impl Feed {
|
||||
.filter(|e| e.kind == EventKind::TextNote)
|
||||
.filter(|e| e.pubkey.as_hex_string() == person.0)
|
||||
.filter(|e| !GLOBALS.dismissed.blocking_read().contains(&e.id))
|
||||
.map(|e| e.to_owned())
|
||||
.collect();
|
||||
|
||||
events.sort_unstable_by(|a, b| b.created_at.cmp(&a.created_at));
|
||||
@ -158,7 +157,6 @@ impl Feed {
|
||||
.iter()
|
||||
.map(|r| r.value().to_owned())
|
||||
.filter(|e| e.kind == EventKind::TextNote)
|
||||
.map(|e| e.to_owned())
|
||||
.collect();
|
||||
|
||||
let mut pubkeys = GLOBALS.people.blocking_read().get_followed_pubkeys();
|
||||
|
@ -27,6 +27,7 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
|
||||
FeedKind::Person(_) => Page::FeedPerson,
|
||||
};
|
||||
|
||||
// Feed Page Selection
|
||||
ui.horizontal(|ui| {
|
||||
if ui
|
||||
.add(SelectableLabel::new(
|
||||
@ -66,6 +67,7 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
|
||||
});
|
||||
ui.separator();
|
||||
|
||||
// Top Buttons
|
||||
Globals::trim_desired_events_sync();
|
||||
let desired_count: isize = match GLOBALS.desired_events.try_read() {
|
||||
Ok(v) => v.len() as isize,
|
||||
@ -77,7 +79,6 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
|
||||
Err(_) => -1,
|
||||
};
|
||||
*/
|
||||
|
||||
ui.with_layout(Layout::right_to_left(Align::TOP), |ui| {
|
||||
if ui
|
||||
.button(&format!("QM {}", desired_count))
|
||||
@ -109,6 +110,7 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
|
||||
.on_hover_text("Requests In Flight (http, not wss)");
|
||||
});
|
||||
|
||||
// Posting Area
|
||||
ui.vertical(|ui| {
|
||||
if !GLOBALS.signer.blocking_read().is_ready() {
|
||||
ui.horizontal(|ui| {
|
||||
@ -116,7 +118,7 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
|
||||
if ui.link("setup your identity").clicked() {
|
||||
app.page = Page::You;
|
||||
}
|
||||
ui.label(" to post or see your replies.");
|
||||
ui.label(" to post.");
|
||||
});
|
||||
} else if !GLOBALS.relays.blocking_read().iter().any(|(_, r)| r.post) {
|
||||
ui.horizontal(|ui| {
|
||||
@ -183,6 +185,15 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
|
||||
render_a_feed(app, ctx, frame, ui, feed, false);
|
||||
}
|
||||
FeedKind::Replies => {
|
||||
if GLOBALS.signer.blocking_read().public_key().is_none() {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("You need to ");
|
||||
if ui.link("setup an identity").clicked() {
|
||||
app.page = Page::Relays;
|
||||
}
|
||||
ui.label(" to see any replies to that identity.");
|
||||
});
|
||||
}
|
||||
let feed = GLOBALS.feed.get_replies();
|
||||
render_a_feed(app, ctx, frame, ui, feed, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user