Skip to content

Commit

Permalink
fix(client_state): backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
technobaboo committed Feb 20, 2024
1 parent f573f7c commit 72babc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/client_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ impl LaunchInfo {
#[derive(Debug, Serialize, Deserialize)]
pub struct ClientState {
pub launch_info: Option<LaunchInfo>,
pub data: Option<Vec<u8>>,
pub data: Vec<u8>,
pub root: Mat4,
pub spatial_anchors: FxHashMap<String, Mat4>,
}
impl ClientState {
pub fn from_deserialized(client: &Client, state: ClientStateInternal) -> Self {
ClientState {
launch_info: LaunchInfo::from_client(client),
data: state.data,
data: state.data.unwrap_or_default(),
root: Self::spatial_transform(client, &state.root.unwrap_or_default())
.unwrap_or_default(),
spatial_anchors: state
Expand Down Expand Up @@ -84,7 +84,7 @@ impl ClientState {
root.set_transform(self.root)
}
ClientStateInternal {
data: self.data.clone(),
data: Some(self.data.clone()),
root: Some("/".to_string()),
spatial_anchors: self
.spatial_anchors
Expand Down Expand Up @@ -116,7 +116,7 @@ impl Default for ClientState {
fn default() -> Self {
Self {
launch_info: None,
data: None,
data: Default::default(),
root: Mat4::IDENTITY,
spatial_anchors: Default::default(),
}
Expand Down

0 comments on commit 72babc0

Please sign in to comment.