🔥 Remove the use of LoadingPage component

For now, the LoadingPage component is kept, just in case.
This commit is contained in:
2024-04-12 14:39:23 +02:00
parent df33e94a12
commit 9951c2fea6

View File

@@ -5,9 +5,6 @@ mod infrastructure;
mod ui; mod ui;
mod utils; mod utils;
use std::time::Duration;
use async_std::task;
use dioxus::prelude::*; use dioxus::prelude::*;
#[cfg(feature = "desktop")] #[cfg(feature = "desktop")]
@@ -21,7 +18,6 @@ use tracing_web::MakeWebConsoleWriter;
use crate::base::{login, sync_rooms}; use crate::base::{login, sync_rooms};
use crate::base::{APP_SETTINGS, ROOMS, SESSION}; use crate::base::{APP_SETTINGS, ROOMS, SESSION};
use crate::ui::components::loading::LoadingPage;
use crate::ui::components::login::Login; use crate::ui::components::login::Login;
use crate::ui::components::main_window::MainWindow; use crate::ui::components::main_window::MainWindow;
@@ -30,17 +26,6 @@ mod base;
fn app() -> Element { fn app() -> Element {
debug!("*** App rendering ***"); debug!("*** App rendering ***");
let mut ready = use_signal(|| false);
// Dummy timer simulating the loading of the application
let _: Coroutine<()> = use_coroutine(|_: UnboundedReceiver<_>| async move {
debug!("Not ready");
task::sleep(Duration::from_secs(3)).await;
// task::sleep(Duration::from_secs(0)).await;
debug!("Ready");
ready.set(true);
});
let login_coro = use_coroutine(|rx| login(rx, &APP_SETTINGS, &SESSION)); let login_coro = use_coroutine(|rx| login(rx, &APP_SETTINGS, &SESSION));
let mut sync_rooms_coro = None; let mut sync_rooms_coro = None;
@@ -100,7 +85,6 @@ fn app() -> Element {
// } // }
} }
if *ready.read() {
if SESSION.read().is_logged { if SESSION.read().is_logged {
debug!("Should render the MainWindow component"); debug!("Should render the MainWindow component");
rsx! { rsx! {
@@ -111,11 +95,6 @@ fn app() -> Element {
Login {}, Login {},
} }
} }
} else {
rsx! {
LoadingPage {},
}
}
} }
fn main() { fn main() {