feat: upgrade to rust nostr 0.28

This commit is contained in:
2024-02-17 09:29:37 +07:00
parent f28a7ae82f
commit f47eba5af7
16 changed files with 352 additions and 210 deletions

View File

@@ -2,7 +2,7 @@ use crate::Nostr;
use nostr_sdk::prelude::*;
use tauri::State;
#[tauri::command(async)]
#[tauri::command]
pub async fn list_connected_relays(nostr: State<'_, Nostr>) -> Result<Vec<Url>, ()> {
let client = &nostr.client;
let relays = client.relays().await;
@@ -11,7 +11,7 @@ pub async fn list_connected_relays(nostr: State<'_, Nostr>) -> Result<Vec<Url>,
Ok(list)
}
#[tauri::command(async)]
#[tauri::command]
pub async fn connect_relay(relay: &str, nostr: State<'_, Nostr>) -> Result<bool, ()> {
let client = &nostr.client;
if let Ok(_) = client.add_relay(relay).await {
@@ -21,7 +21,7 @@ pub async fn connect_relay(relay: &str, nostr: State<'_, Nostr>) -> Result<bool,
}
}
#[tauri::command(async)]
#[tauri::command]
pub async fn remove_relay(relay: &str, nostr: State<'_, Nostr>) -> Result<bool, ()> {
let client = &nostr.client;
if let Ok(_) = client.remove_relay(relay).await {