💄 Display ChatsWindow only once the user logged

This commit is contained in:
2023-08-21 21:43:42 +02:00
parent f79bf329a5
commit 4988054dae
2 changed files with 21 additions and 14 deletions

View File

@@ -1,14 +1,12 @@
use dioxus::prelude::*;
use dioxus_std::utils::rw::use_rw;
use dioxus_std::utils::rw::UseRw;
use crate::base::Store;
use crate::components::contacts_window::contacts_window::ContactsWindow;
use crate::components::login::Login;
#[inline_props]
pub fn MainWindow(cx: Scope) -> Element {
let rw_store = use_rw(cx, || Store::new());
pub fn MainWindow<'a>(cx: Scope, rw_store: &'a UseRw<Store>) -> Element {
let is_logged = rw_store.read().unwrap().is_logged;
cx.render(rsx! {