Make config window into config browser

This commit is contained in:
Michael Mikovsky
2025-12-01 20:13:35 -07:00
parent d1a0050f45
commit 7f2b145a7a
5 changed files with 241 additions and 55 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
use egui::{Align2, Area, Color32, Frame, Order, Sense, UiKind, Vec2, mutex::Mutex};
use serde::{Deserialize, Serialize, de::DeserializeOwned};
use serde::de::DeserializeOwned;
use serde_json::json;
use std::{marker::PhantomData, sync::Arc};
use std::sync::Arc;
use wasm_bindgen::prelude::Closure;
#[derive(serde::Deserialize, serde::Serialize)]
@@ -152,7 +152,7 @@ impl Auth {
pub fn get<T, F>(&self, path: &str, ret: F)
where
F: FnOnce(Result<T, String>) + 'static,
F: FnOnce(T) + 'static,
T: DeserializeOwned,
{
if let Some(ref token) = self.token {
@@ -163,7 +163,7 @@ impl Auth {
Closure::once_into_js(move |ok: bool, response: String| {
if ok {
crate::log(&response);
if let Ok(value) = serde_json::from_str::<Result<T, String>>(&response) {
if let Ok(value) = serde_json::from_str::<T>(&response) {
ret(value)
} else {
*(state.lock()) = AuthState::Error("Malformed Response".into());