|
|
|
@ -16,6 +16,10 @@ fn user_icon<G: Html>(cx: Scope, _props: ()) -> View<G> {
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(client)]
|
|
|
|
#[cfg(client)]
|
|
|
|
spawn_local_scoped(cx, async move {
|
|
|
|
spawn_local_scoped(cx, async move {
|
|
|
|
|
|
|
|
// Since logged in is set to false by default (on the first page load) we have to check
|
|
|
|
|
|
|
|
if *global_state.logged_in.get() {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
let status = api_scope_ref.is_authenticated().await.unwrap().status();
|
|
|
|
let status = api_scope_ref.is_authenticated().await.unwrap().status();
|
|
|
|
if status == 200 {
|
|
|
|
if status == 200 {
|
|
|
|
global_state.logged_in.set(true);
|
|
|
|
global_state.logged_in.set(true);
|
|
|
|
|