chore: restructure and refine the ui (#199)
* update deps * clean up * add account crate * add person crate * add chat and chat ui crates * . * clean up the ui crate * . * .
This commit is contained in:
@@ -1148,7 +1148,8 @@ impl AppState {
|
||||
match event.created_at >= self.initialized_at {
|
||||
// New message: send a signal to notify the UI
|
||||
true => {
|
||||
self.signal.send(SignalKind::NewMessage((id, event))).await;
|
||||
let new_message = NewMessage::new(id, event);
|
||||
self.signal.send(SignalKind::NewMessage(new_message)).await;
|
||||
}
|
||||
// Old message: Coop is probably processing the user's messages during initial load
|
||||
false => {
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
use flume::{Receiver, Sender};
|
||||
use nostr_sdk::prelude::*;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct NewMessage {
|
||||
pub gift_wrap: EventId,
|
||||
pub rumor: UnsignedEvent,
|
||||
}
|
||||
|
||||
impl NewMessage {
|
||||
pub fn new(gift_wrap: EventId, rumor: UnsignedEvent) -> Self {
|
||||
Self { gift_wrap, rumor }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct AuthRequest {
|
||||
pub url: RelayUrl,
|
||||
@@ -111,7 +123,7 @@ pub enum SignalKind {
|
||||
NewProfile(Profile),
|
||||
|
||||
/// A signal to notify UI that a new gift wrap event has been received
|
||||
NewMessage((EventId, UnsignedEvent)),
|
||||
NewMessage(NewMessage),
|
||||
|
||||
/// A signal to notify UI that no messaging relays for current user was found
|
||||
MessagingRelaysNotFound,
|
||||
|
||||
Reference in New Issue
Block a user