feat: add check active account before init client

This commit is contained in:
2024-02-05 13:36:10 +07:00
parent 2a58326cd1
commit 08fa7de01d
9 changed files with 85 additions and 76 deletions

View File

@@ -1,11 +1,11 @@
use crate::AppState;
use crate::Nostr;
use nostr_sdk::prelude::*;
use std::time::Duration;
use tauri::State;
#[tauri::command(async)]
pub async fn get_metadata(npub: String, app_state: State<'_, AppState>) -> Result<Metadata, ()> {
let client = &app_state.nostr;
pub async fn get_metadata(npub: String, nostr: State<'_, Nostr>) -> Result<Metadata, ()> {
let client = &nostr.client;
let public_key = XOnlyPublicKey::from_bech32(npub).unwrap();