feat: settings screens
This commit is contained in:
@@ -234,7 +234,7 @@
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"title": "User"
|
||||
"title": "Account"
|
||||
},
|
||||
"zap": {
|
||||
"title": "Zap",
|
||||
|
||||
@@ -103,6 +103,7 @@ fn main() {
|
||||
nostr::keys::create_keys,
|
||||
nostr::keys::save_key,
|
||||
nostr::keys::get_encrypted_key,
|
||||
nostr::keys::get_stored_nsec,
|
||||
nostr::keys::verify_signer,
|
||||
nostr::keys::load_selected_account,
|
||||
nostr::keys::event_to_bech32,
|
||||
|
||||
@@ -103,6 +103,17 @@ pub fn get_encrypted_key(npub: &str, password: &str) -> Result<String, String> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_stored_nsec(npub: &str) -> Result<String, String> {
|
||||
let keyring = Entry::new("Lume Secret Storage", npub).unwrap();
|
||||
|
||||
if let Ok(nsec) = keyring.get_password() {
|
||||
Ok(nsec)
|
||||
} else {
|
||||
Err("Key not found".into())
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn load_selected_account(npub: &str, state: State<'_, Nostr>) -> Result<bool, String> {
|
||||
let client = &state.client;
|
||||
|
||||
@@ -60,15 +60,18 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
|
||||
println!("todo!")
|
||||
}
|
||||
"settings" => {
|
||||
let _ =
|
||||
WebviewWindowBuilder::new(app, "settings", WebviewUrl::App(PathBuf::from("settings")))
|
||||
.title("Editor")
|
||||
.min_inner_size(600., 500.)
|
||||
.inner_size(800., 500.)
|
||||
.hidden_title(true)
|
||||
.title_bar_style(TitleBarStyle::Overlay)
|
||||
.build()
|
||||
.unwrap();
|
||||
let _ = WebviewWindowBuilder::new(
|
||||
app,
|
||||
"settings",
|
||||
WebviewUrl::App(PathBuf::from("settings/general")),
|
||||
)
|
||||
.title("Editor")
|
||||
.min_inner_size(600., 500.)
|
||||
.inner_size(800., 500.)
|
||||
.hidden_title(true)
|
||||
.title_bar_style(TitleBarStyle::Overlay)
|
||||
.build()
|
||||
.unwrap();
|
||||
}
|
||||
"quit" => {
|
||||
app.exit(0);
|
||||
|
||||
Reference in New Issue
Block a user