feat: account switcher

This commit is contained in:
2024-02-24 14:41:57 +07:00
parent 84584a4d1f
commit 88a6c3c81f
14 changed files with 114 additions and 34 deletions

View File

@@ -47,3 +47,18 @@ default = ["custom-protocol"]
# this feature is used used for production builds where `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = ["tauri/custom-protocol"]
[profile.dev.package."*"]
opt-level = 3
[profile.release]
codegen-units = 1
lto = true
panic = "abort"
incremental = false
opt-level = 3
strip = true
rpath = false
debug = false
debug-assertions = false
overflow-checks = false

View File

@@ -26,8 +26,11 @@ pub async fn get_profile(id: &str, state: State<'_, Nostr>) -> Result<Metadata,
if let Ok(events) = query {
if let Some(event) = events.first() {
let metadata: Metadata = Metadata::from_json(&event.content).unwrap();
Ok(metadata)
if let Ok(metadata) = Metadata::from_json(&event.content) {
Ok(metadata)
} else {
Err("Parse metadata failed".into())
}
} else {
let rand_metadata = Metadata::new();
Ok(rand_metadata)