♻️ Use of the assets management introduced by Dioxus 0.6.0
All checks were successful
ci/woodpecker/push/dockerize Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful

Cf. https://dioxuslabs.com/blog/release-060#stabilizing-manganis-asset-system
This commit is contained in:
2025-04-21 09:39:54 +02:00
parent 219fac87b1
commit 722d98f5d1
6 changed files with 220 additions and 236 deletions

View File

@@ -10,6 +10,7 @@ mod utils;
use std::rc::Rc;
use dioxus::document::{Link, Style};
use dioxus::prelude::*;
use futures_util::stream::StreamExt;
use tracing::{debug, error, warn};
@@ -89,13 +90,24 @@ async fn login(mut rx: UnboundedReceiver<bool>, session: &GlobalSignal<Session>)
fn app() -> Element {
let login_coro = use_coroutine(|rx| login(rx, &SESSION));
if !SESSION.read().is_logged {
let is_logged = SESSION.read().is_logged;
if !is_logged {
login_coro.send(false);
rsx! {
}
rsx! {
Link {
href: asset!("public/fonts/Geist/Geist-Medium.woff2"), as: "font", type: "font/woff2"
}
Style {
id: "style-head", "body {{ font-family: 'Geist'; font-weight: normal; }}"
}
if !is_logged {
Login {}
}
} else {
rsx! {
else {
Conversations {}
}
}