fix browser not updating live
This commit is contained in:
parent
d54d53bb09
commit
54fa246229
1 changed files with 15 additions and 14 deletions
|
@ -59,20 +59,21 @@ pub fn Browser() -> impl IntoView {
|
|||
<th class="border-b"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<For
|
||||
each=move || game_browser_context()
|
||||
key=|game| game.uuid.clone()
|
||||
children=move |game| {
|
||||
|
||||
// This rebuilds the entire browser each time it runs but using <For /> won't update the children if the id doesn't change
|
||||
{game_browser_context()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|game| {
|
||||
view! {
|
||||
{
|
||||
logging::log!("I ran");
|
||||
}
|
||||
<tr>
|
||||
<td class="text-center border-b">{&game.name}</td>
|
||||
<td class="text-center border-b">{&game.host}</td>
|
||||
<td class="text-center border-b">
|
||||
{&game.players.to_string()}
|
||||
</td>
|
||||
<td class="text-center border-b">
|
||||
{&game.packs.len().to_string()}
|
||||
</td>
|
||||
<td class="text-center border-b">{game.name}</td>
|
||||
<td class="text-center border-b">{game.host}</td>
|
||||
<td class="text-center border-b">{game.players}</td>
|
||||
<td class="text-center border-b">{game.packs.len()}</td>
|
||||
<td class="text-center border-b">
|
||||
<button
|
||||
type="button"
|
||||
|
@ -95,8 +96,8 @@ pub fn Browser() -> impl IntoView {
|
|||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
/>
|
||||
})
|
||||
.collect_view()}
|
||||
</table>
|
||||
</div>
|
||||
</Show>
|
||||
|
|
Loading…
Add table
Reference in a new issue