Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to
This commit is contained in:
22 files changed
+12
-25
No files matched your search
@@ -14,8 +14,6 @@ pub(crate) mod views;
|
||||
use oidc::{AuthRequestState, AuthTokenState};
|
||||
use router::Route;
|
||||
|
||||
use dioxus::router::prelude::*;
|
||||
|
||||
use crate::{
|
||||
constants::{DIOXUS_FRONT_AUTH_REQUEST, DIOXUS_FRONT_AUTH_TOKEN},
|
||||
oidc::ClientState,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use crate::views::{header::AuthHeader, home::Home, login::Login, not_found::NotFound};
|
||||
use dioxus::prelude::*;
|
||||
use dioxus::router::prelude::*;
|
||||
|
||||
#[derive(Routable, Clone)]
|
||||
pub enum Route {
|
||||
|
||||
@@ -127,7 +127,7 @@ pub fn RefreshToken(cx: Scope<ClientProps>) -> Element {
|
||||
|
||||
#[component]
|
||||
pub fn LoadClient() -> Element {
|
||||
let init_client_future = use_future(|| async move { init_oidc_client().await });
|
||||
let init_client_future = use_future(move || async move { init_oidc_client().await });
|
||||
let fermi_client: &UseAtomRef<ClientState> = use_atom_ref(&FERMI_CLIENT);
|
||||
cx.render(match init_client_future.value() {
|
||||
Some(client_props) => match client_props {
|
||||
|
||||
Reference in new issue
Block a user