Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ab1b50310 | ||
|
|
ede1b8497f |
Generated
+1
-1
@@ -345,7 +345,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cnats"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-nats",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cnats"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
|
||||
+17
-6
@@ -472,19 +472,30 @@ fn CallPanel(room: Memo<String>, me: String) -> impl IntoView {
|
||||
}
|
||||
.into_any()
|
||||
}
|
||||
// Must mirror the hydrate branch's default (not-in-call) markup exactly -
|
||||
// hydration reconciles this SSR output against what the hydrate branch
|
||||
// above expects to find, and an empty div here (vs. the button hydrate
|
||||
// wants) is a hydration mismatch that panics and traps the whole wasm
|
||||
// instance, killing all reactivity on the page.
|
||||
// Must mirror the hydrate branch's default (not-in-call) markup AND its
|
||||
// node structure exactly. The hydrate branch puts the button inside a
|
||||
// dynamic child (`{move || ...}`), which serializes hydration-marker
|
||||
// comments around it; if SSR emits a plain static button instead, the
|
||||
// hydrate walk can't find the dynamic node, so it never attaches
|
||||
// `on:click` - the call button is dead on the first lobby load until a
|
||||
// client-side nav re-renders the subtree. So: same `{move || ...}` wrapper,
|
||||
// and only the attributes the hydrate button actually serializes to
|
||||
// (class/title/aria-label; `on:click` is a JS listener, not HTML). No
|
||||
// `disabled` here - the hydrate button has none and hydration won't clear
|
||||
// a stray SSR-only attribute.
|
||||
#[cfg(not(feature = "hydrate"))]
|
||||
{
|
||||
let _ = (room, me);
|
||||
view! {
|
||||
<div class="call-panel">
|
||||
<button class="call-join" title="join call" aria-label="join call" disabled=true>
|
||||
{move || {
|
||||
view! {
|
||||
<button class="call-join" title="join call" aria-label="join call">
|
||||
"☎"
|
||||
</button>
|
||||
}
|
||||
.into_any()
|
||||
}}
|
||||
</div>
|
||||
}
|
||||
.into_any()
|
||||
|
||||
Reference in New Issue
Block a user