diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c9f420c..d7a977e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -16,7 +16,7 @@ - + diff --git a/app.rs b/app.rs deleted file mode 100644 index 565debe..0000000 --- a/app.rs +++ /dev/null @@ -1,29 +0,0 @@ -use dioxus::prelude::*; -use dioxus_router::prelude::*; -use crate::example_data::create_example_room; -use std::collections::HashMap; -use freenet_stdlib::prelude::{ContractCode, ContractInstanceId}; -use crate::constants::ROOM_CONTRACT_WASM; - -fn App(cx: Scope) -> Element { - let rooms = use_signal(|| { - let mut rooms = HashMap::new(); - let (room_key, room_state) = create_example_room(); - rooms.insert(room_key, (room_state, None)); - rooms - }); - - let current_room = use_signal(|| None); - let current_room_state = use_memo(|| current_room.read().and_then(|key| rooms.read().get(&key).map(|(state, _)| state.clone())), [current_room, rooms]); - - cx.render(rsx! { - Router { - Switch { - Route { to: "/", ChatRooms { rooms: rooms, current_room: current_room } } - Route { to: "/chat", MainChat { current_room: current_room, current_room_state: current_room_state } } - Route { to: "/members", MemberList { current_room: current_room, current_room_state: current_room_state } } - Route { to: "/modal", Modal { current_room: current_room, current_room_state: current_room_state } } - } - } - }) -} diff --git a/ui/src/components/app.rs b/ui/src/components/app.rs index 754789c..fe74e69 100644 --- a/ui/src/components/app.rs +++ b/ui/src/components/app.rs @@ -8,6 +8,7 @@ use common::room_state::member::MemberId; use dioxus::prelude::*; use document::Stylesheet; use ed25519_dalek::VerifyingKey; +use crate::components::app::freenet_api::FreenetApiSynchronizer; pub fn App() -> Element { use_context_provider(|| Signal::new(initial_rooms())); @@ -16,7 +17,7 @@ pub fn App() -> Element { use_context_provider(|| Signal::new(EditRoomModalSignal { room: None })); use_context_provider(|| Signal::new(CreateRoomModalSignal { show: false })); - //connect_to_freenet(); + let _freenet_api_synchronizer = FreenetApiSynchronizer::start(); rsx! { Stylesheet { href: asset!("./assets/bulma.min.css") }