feat: improve some functions

This commit is contained in:
reya
2024-08-04 10:23:15 +07:00
parent 35620fb1a9
commit 587fd7301b
6 changed files with 79 additions and 35 deletions

View File

@@ -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;