feat: improve some functions
This commit is contained in:
@@ -45,6 +45,15 @@ pub async fn get_metadata(id: String, state: State<'_, Nostr>) -> Result<String,
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub fn delete_account(id: String) -> Result<(), String> {
|
||||
let keyring = Entry::new("coop", &id).map_err(|e| e.to_string())?;
|
||||
let _ = keyring.delete_credential();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn create_account(
|
||||
@@ -258,7 +267,7 @@ pub async fn login(
|
||||
.get_events_from(
|
||||
urls.clone(),
|
||||
vec![Filter::new().kind(Kind::TextNote).limit(0)],
|
||||
None,
|
||||
Some(Duration::from_secs(5)),
|
||||
)
|
||||
.await;
|
||||
|
||||
|
||||
@@ -19,17 +19,13 @@ pub struct Nostr {
|
||||
}
|
||||
|
||||
// TODO: Allow user config bootstrap relays.
|
||||
pub const BOOTSTRAP_RELAYS: [&str; 4] = [
|
||||
"wss://relay.damus.io/",
|
||||
"wss://relay.nostr.net/",
|
||||
"wss://relay.0xchat.com/",
|
||||
"wss://auth.nostr1.com/",
|
||||
];
|
||||
pub const BOOTSTRAP_RELAYS: [&str; 2] = ["wss://relay.damus.io/", "wss://relay.nostr.net/"];
|
||||
|
||||
fn main() {
|
||||
let invoke_handler = {
|
||||
let builder = tauri_specta::ts::builder().commands(tauri_specta::collect_commands![
|
||||
login,
|
||||
delete_account,
|
||||
create_account,
|
||||
import_key,
|
||||
connect_account,
|
||||
|
||||
Reference in New Issue
Block a user