Upgraded Leptos to 0.8. Fixes #1

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-12 07:51:29 +02:00
co-authored by Claude Opus 5.5
parent 01d48ac0e4
commit ec73351405
55 changed files with 1371 additions and 1097 deletions
+5 -6
View File
@@ -1,6 +1,6 @@
use std::collections::HashMap;
use lazy_static::lazy_static;
use leptos::*;
use leptos::prelude::*;
use crate::locales::Locales;
lazy_static! {
@@ -182,16 +182,15 @@ lazy_static! {
};
}
fn get_locales() -> Vec<Option<String>> {
pub fn get_locales() -> Vec<Option<String>> {
#[cfg(not(feature = "ssr"))]
{
use_context::<Locales>().unwrap_or(Locales(vec![])).0
// Context is not available in event handlers, ask the browser there
use_context::<Locales>().unwrap_or_else(crate::locales::browser_locales).0
}
#[cfg(feature = "ssr")]
{
use actix_web::HttpRequest;
let req = use_context::<HttpRequest>();
let req = use_context::<leptos_actix::Request>();
if let Some(r) = req {
if let Some(al) = r.head().headers.get("accept-language") {
Locales(al.to_str().unwrap_or("").split(",").map(|l| Some(l.to_string())).collect()).0