add relay states to ui
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m33s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m31s
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m33s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m31s
This commit is contained in:
@@ -9,6 +9,20 @@ pub enum DeviceState {
|
||||
Set,
|
||||
}
|
||||
|
||||
impl DeviceState {
|
||||
pub fn initial(&self) -> bool {
|
||||
matches!(self, DeviceState::Initial)
|
||||
}
|
||||
|
||||
pub fn requesting(&self) -> bool {
|
||||
matches!(self, DeviceState::Requesting)
|
||||
}
|
||||
|
||||
pub fn set(&self) -> bool {
|
||||
matches!(self, DeviceState::Set)
|
||||
}
|
||||
}
|
||||
|
||||
/// Announcement
|
||||
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct Announcement {
|
||||
|
||||
@@ -30,12 +30,12 @@ pub struct DeviceRegistry {
|
||||
/// Device signer
|
||||
pub device_signer: Entity<Option<Arc<dyn NostrSigner>>>,
|
||||
|
||||
/// Device state
|
||||
pub state: DeviceState,
|
||||
|
||||
/// Device requests
|
||||
requests: Entity<HashSet<Event>>,
|
||||
|
||||
/// Device state
|
||||
state: DeviceState,
|
||||
|
||||
/// Async tasks
|
||||
tasks: Vec<Task<Result<(), Error>>>,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user