mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Correctly unset pending flag
This commit is contained in:
parent
d33d21ce72
commit
535e05f7b2
1 changed files with 6 additions and 2 deletions
|
@ -194,6 +194,9 @@ impl XRMethods for XR {
|
||||||
required_features.push(s)
|
required_features.push(s)
|
||||||
} else {
|
} else {
|
||||||
warn!("Unable to convert required feature to string");
|
warn!("Unable to convert required feature to string");
|
||||||
|
if mode != XRSessionMode::Inline {
|
||||||
|
self.pending_immersive_session.set(false);
|
||||||
|
}
|
||||||
promise.reject_error(Error::NotSupported);
|
promise.reject_error(Error::NotSupported);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
@ -220,7 +223,6 @@ impl XRMethods for XR {
|
||||||
optional_features,
|
optional_features,
|
||||||
};
|
};
|
||||||
|
|
||||||
let promise = Promise::new_in_current_compartment(&self.global(), comp);
|
|
||||||
let mut trusted = Some(TrustedPromise::new(promise.clone()));
|
let mut trusted = Some(TrustedPromise::new(promise.clone()));
|
||||||
let this = Trusted::new(self);
|
let this = Trusted::new(self);
|
||||||
let (task_source, canceller) = window
|
let (task_source, canceller) = window
|
||||||
|
@ -253,7 +255,6 @@ impl XRMethods for XR {
|
||||||
window
|
window
|
||||||
.webxr_registry()
|
.webxr_registry()
|
||||||
.request_session(mode.into(), init, sender, frame_sender);
|
.request_session(mode.into(), init, sender, frame_sender);
|
||||||
|
|
||||||
promise
|
promise
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,6 +275,9 @@ impl XR {
|
||||||
let session = match response {
|
let session = match response {
|
||||||
Ok(session) => session,
|
Ok(session) => session,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
|
if mode != XRSessionMode::Inline {
|
||||||
|
self.pending_immersive_session.set(false);
|
||||||
|
}
|
||||||
promise.reject_error(Error::NotSupported);
|
promise.reject_error(Error::NotSupported);
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue