Skip to content

Commit

Permalink
Fixes alerts closing
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Jan 2, 2025
1 parent ec77441 commit 9136b8f
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions front/src/components/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ pub fn Component() -> yew::Html {
let context = yew::functional::use_reducer(Context::default);

yew::html! {
<ComponentLoc {context} />
<yew::ContextProvider<crate::Context> context={ context.clone() }>
<ComponentLoc {context} />
</yew::ContextProvider<crate::Context>>
}
}

Expand Down Expand Up @@ -167,25 +169,17 @@ impl yew::Component for ComponentLoc {
should_render
}

fn view(&self, ctx: &yew::Context<Self>) -> yew::Html {
let context = &ctx.props().context;

yew::html! {
<yew::ContextProvider<crate::Context> context={ context.clone() }>
{
if self.auth {
yew::html! {
<yew_router::router::BrowserRouter>
<yew_router::Switch<Route> render={ switch } />
</yew_router::router::BrowserRouter>
}
} else {
yew::html! {
<super::Login />
}
}
fn view(&self, _: &yew::Context<Self>) -> yew::Html {
if self.auth {
yew::html! {
<yew_router::router::BrowserRouter>
<yew_router::Switch<Route> render={ switch } />
</yew_router::router::BrowserRouter>
}
} else {
yew::html! {
<super::Login />
}
</yew::ContextProvider<crate::Context>>
}
}

Expand Down

0 comments on commit 9136b8f

Please sign in to comment.