Skip to content

Commit

Permalink
Correctly unset pending flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 21, 2020
1 parent d33d21c commit 535e05f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/script/dom/xr.rs
Expand Up @@ -194,6 +194,9 @@ impl XRMethods for XR {
required_features.push(s)
} else {
warn!("Unable to convert required feature to string");
if mode != XRSessionMode::Inline {
self.pending_immersive_session.set(false);
}
promise.reject_error(Error::NotSupported);
return promise;
}
Expand All @@ -220,7 +223,6 @@ impl XRMethods for XR {
optional_features,
};

let promise = Promise::new_in_current_compartment(&self.global(), comp);
let mut trusted = Some(TrustedPromise::new(promise.clone()));
let this = Trusted::new(self);
let (task_source, canceller) = window
Expand Down Expand Up @@ -253,7 +255,6 @@ impl XRMethods for XR {
window
.webxr_registry()
.request_session(mode.into(), init, sender, frame_sender);

promise
}

Expand All @@ -274,6 +275,9 @@ impl XR {
let session = match response {
Ok(session) => session,
Err(_) => {
if mode != XRSessionMode::Inline {
self.pending_immersive_session.set(false);
}
promise.reject_error(Error::NotSupported);
return;
},
Expand Down

0 comments on commit 535e05f

Please sign in to comment.