refactor encryption dropdown menu
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m43s
Rust / build (macos-latest, stable) (push) Has been cancelled
Rust / build (windows-latest, stable) (push) Has been cancelled

This commit is contained in:
2026-02-28 15:22:46 +07:00
parent 2423cdca19
commit 635c500233
6 changed files with 207 additions and 75 deletions

View File

@@ -1,3 +1,5 @@
use std::fmt::Display;
use gpui::SharedString;
use nostr_sdk::prelude::*;
@@ -9,6 +11,16 @@ pub enum DeviceState {
Set,
}
impl Display for DeviceState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
DeviceState::Idle => write!(f, "Idle"),
DeviceState::Requesting => write!(f, "Wait for approval"),
DeviceState::Set => write!(f, "Encryption Key is ready"),
}
}
}
impl DeviceState {
pub fn idle(&self) -> bool {
matches!(self, DeviceState::Idle)