feat: add editor screen
This commit is contained in:
@@ -4,7 +4,7 @@ use tauri::State;
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn list_connected_relays(state: State<'_, Nostr>) -> Result<Vec<Url>, ()> {
|
||||
let client = state.client.lock().await;
|
||||
let client = &state.client;
|
||||
let relays = client.relays().await;
|
||||
let list: Vec<Url> = relays.into_keys().collect();
|
||||
|
||||
@@ -13,7 +13,7 @@ pub async fn list_connected_relays(state: State<'_, Nostr>) -> Result<Vec<Url>,
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn connect_relay(relay: &str, state: State<'_, Nostr>) -> Result<bool, ()> {
|
||||
let client = state.client.lock().await;
|
||||
let client = &state.client;
|
||||
if let Ok(_) = client.add_relay(relay).await {
|
||||
Ok(true)
|
||||
} else {
|
||||
@@ -23,7 +23,7 @@ pub async fn connect_relay(relay: &str, state: State<'_, Nostr>) -> Result<bool,
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn remove_relay(relay: &str, state: State<'_, Nostr>) -> Result<bool, ()> {
|
||||
let client = state.client.lock().await;
|
||||
let client = &state.client;
|
||||
if let Ok(_) = client.remove_relay(relay).await {
|
||||
Ok(true)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user