fix: ⚡ now whole gui waits for websocket connection establishment
This commit is contained in:
parent
693c6353a9
commit
16481ed7bd
3 changed files with 16 additions and 14 deletions
|
@ -7,13 +7,17 @@ use leptos::{
|
|||
};
|
||||
use wasm_bindgen_futures::spawn_local;
|
||||
|
||||
use crate::{media::audio, webrtc::WebRTC};
|
||||
use crate::{media::audio, signal::wait_until_communication_is_ready, webrtc::WebRTC};
|
||||
|
||||
pub fn app() -> impl IntoView {
|
||||
let audio_stream = LocalResource::new(|| audio());
|
||||
let wait_until_communication_is_ready =
|
||||
LocalResource::new(|| wait_until_communication_is_ready());
|
||||
|
||||
let props = ShowProps::builder()
|
||||
.when(move || audio_stream.read().is_some())
|
||||
.when(move || {
|
||||
audio_stream.read().is_some() && wait_until_communication_is_ready.read().is_some()
|
||||
})
|
||||
.children(ToChildren::to_children(move || {
|
||||
let audio_stream = audio_stream.read();
|
||||
let audio_stream = audio_stream.as_deref().unwrap().clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue