feat: migrate frontend to new backend

This commit is contained in:
2024-02-08 21:24:08 +07:00
parent 17052aeeaa
commit ec78cf8bf7
34 changed files with 478 additions and 650 deletions

View File

@@ -8,12 +8,10 @@ pub async fn get_event(id: &str, nostr: State<'_, Nostr>) -> Result<String, ()>
let client = &nostr.client;
let event_id;
if id.starts_with("note1") {
event_id = EventId::from_bech32(id).unwrap();
} else if id.starts_with("nevent1") {
event_id = EventId::from_bech32(id).unwrap();
} else if id.starts_with("naddr1") {
if id.starts_with("note") {
event_id = EventId::from_bech32(id).unwrap();
} else if id.starts_with("nevent") {
event_id = Nip19Event::from_bech32(id).unwrap().event_id;
} else {
event_id = EventId::from_hex(id).unwrap();
}