From c4b27b8a7bb4d7b1073dd432fba6f729cfebf159 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 30 Apr 2025 23:19:34 -0400 Subject: [PATCH] Fix the web version for the new API --- src/lib.rs | 9 +++++++++ web/index.html | 30 +++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5e409c4..e5822c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -392,3 +392,12 @@ pub async extern "C" fn archive_character_base64( .map(|x| BASE64_STANDARD.encode(x))?; return Ok(format!("data:application/octet-stream;charset=utf-16le;base64,{buf}").into()); } + +#[cfg(target_family = "wasm")] +#[wasm_bindgen] +pub async extern "C" fn search_for_character(name: &str) -> Option { + #[cfg(feature = "debug")] + console_error_panic_hook::set_once(); + + search_character(name).await +} diff --git a/web/index.html b/web/index.html index fe11f30..6ae84ab 100644 --- a/web/index.html +++ b/web/index.html @@ -5,19 +5,31 @@ Auracite