diff --git a/crates/device/src/lib.rs b/crates/device/src/lib.rs index add0642..c5ab2c7 100644 --- a/crates/device/src/lib.rs +++ b/crates/device/src/lib.rs @@ -11,7 +11,7 @@ use gpui::{ }; use nostr_sdk::prelude::*; use person::PersonRegistry; -use state::{Announcement, NostrRegistry, StateEvent, TIMEOUT, app_name}; +use state::{Announcement, CLIENT_NAME, NostrRegistry, StateEvent, TIMEOUT}; use theme::ActiveTheme; use ui::avatar::Avatar; use ui::button::Button; @@ -301,7 +301,7 @@ impl DeviceRegistry { // Construct an announcement event let builder = EventBuilder::new(Kind::Custom(10044), "").tags(vec![ Tag::custom(TagKind::custom("n"), vec![n]), - Tag::client(app_name()), + Tag::client(CLIENT_NAME), ]); // Sign the event with user's signer @@ -406,7 +406,7 @@ impl DeviceRegistry { // Construct an event for device key request let builder = EventBuilder::new(Kind::Custom(4454), "").tags(vec![ Tag::custom(TagKind::custom("P"), vec![app_pubkey]), - Tag::client(app_name()), + Tag::client(CLIENT_NAME), ]); // Sign the event with user's signer diff --git a/crates/state/src/constants.rs b/crates/state/src/constants.rs index 56a1d74..24d8d02 100644 --- a/crates/state/src/constants.rs +++ b/crates/state/src/constants.rs @@ -1,5 +1,3 @@ -use std::sync::OnceLock; - /// Client name (Application name) pub const CLIENT_NAME: &str = "Coop"; @@ -51,15 +49,3 @@ pub const BOOTSTRAP_RELAYS: [&str; 3] = [ "wss://relay.primal.net", "wss://user.kindpag.es", ]; - -static APP_NAME: OnceLock = OnceLock::new(); - -/// Get the app name -pub fn app_name() -> &'static String { - APP_NAME.get_or_init(|| { - let devicename = whoami::devicename(); - let platform = whoami::platform(); - - format!("{CLIENT_NAME} on {platform} ({devicename})") - }) -}