mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-29 02:41:08 +00:00
replace <Transition> with <Suspense> to fix crash
This commit is contained in:
parent
910c7b5d8f
commit
4e77e65362
2 changed files with 6 additions and 7 deletions
|
@ -35,8 +35,7 @@ pub fn site() -> Resource<SiteView> {
|
|||
}
|
||||
|
||||
pub fn is_logged_in() -> bool {
|
||||
//site().with_default(|site| site.my_profile.is_some())
|
||||
false
|
||||
site().with_default(|site| site.my_profile.is_some())
|
||||
}
|
||||
pub fn is_admin() -> bool {
|
||||
site().with_default(|site| {
|
||||
|
|
|
@ -50,7 +50,7 @@ pub fn Nav() -> impl IntoView {
|
|||
<li>
|
||||
<A href="/articles">"Articles"</A>
|
||||
</li>
|
||||
<Transition>
|
||||
<Suspense>
|
||||
<Show when=is_logged_in>
|
||||
<li>
|
||||
<A href="/create-article">"Create Article"</A>
|
||||
|
@ -59,12 +59,12 @@ pub fn Nav() -> impl IntoView {
|
|||
<A href="/notifications">
|
||||
"Notifications "
|
||||
<span class="indicator-item indicator-end badge badge-neutral">
|
||||
{move || notification_count.get()}
|
||||
<Suspense>{move || notification_count.get()}</Suspense>
|
||||
</span>
|
||||
</A>
|
||||
</li>
|
||||
</Show>
|
||||
</Transition>
|
||||
</Suspense>
|
||||
<li>
|
||||
<form
|
||||
class="form-control m-0 p-1"
|
||||
|
@ -96,7 +96,7 @@ pub fn Nav() -> impl IntoView {
|
|||
</li>
|
||||
</ul>
|
||||
<div class="divider"></div>
|
||||
<Transition>
|
||||
<Suspense>
|
||||
<Show
|
||||
when=is_logged_in
|
||||
fallback=move || {
|
||||
|
@ -137,7 +137,7 @@ pub fn Nav() -> impl IntoView {
|
|||
}
|
||||
|
||||
</Show>
|
||||
</Transition>
|
||||
</Suspense>
|
||||
<div class="grow min-h-2"></div>
|
||||
<div class="m-1 grid gap-2">
|
||||
<label class="flex cursor-pointer gap-2">
|
||||
|
|
Loading…
Reference in a new issue