Moved modal state into global state
All checks were successful
Build Crate / build (push) Successful in 1m39s
All checks were successful
Build Crate / build (push) Successful in 1m39s
unfortunate but easiest way
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use perseus::{prelude::*, state::GlobalStateCreator};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::state_enums::LoginState;
|
||||
use crate::state_enums::{LoginState, OpenState};
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(engine)] {
|
||||
@@ -16,6 +16,8 @@ cfg_if::cfg_if! {
|
||||
pub struct AppState {
|
||||
#[rx(nested)]
|
||||
pub auth: AuthData,
|
||||
#[rx(nested)]
|
||||
pub modals_open: ModalOpenData,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, ReactiveState, Clone)]
|
||||
@@ -26,6 +28,12 @@ pub struct AuthData {
|
||||
pub claims: Claims,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, ReactiveState, Clone)]
|
||||
#[rx(alias = "ModalOpenDataRx")]
|
||||
pub struct ModalOpenData {
|
||||
pub login: OpenState,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, ReactiveState, Clone)]
|
||||
#[rx(alias = "ClaimsRx")]
|
||||
pub struct Claims {}
|
||||
@@ -42,6 +50,9 @@ pub async fn get_build_state() -> AppState {
|
||||
username: None,
|
||||
claims: Claims {},
|
||||
},
|
||||
modals_open: ModalOpenData {
|
||||
login: OpenState::Closed,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user