- From: Wanming Lin <notifications@github.com>
- Date: Tue, 13 Nov 2018 21:04:41 -0800
- To: w3c/screen-orientation <screen-orientation@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 14 November 2018 05:05:03 UTC
@marcoscaceres, the `lock` promise will resolve with `undefined`, and actually we don't need `if...else` at all. ``` async function fixpositionscreen(){ try { alert('trying...'); await screen.orientation.lock('portrait-primary')); alert('yes, it was blocked'); } catch(err){ alert('no, it was not blocked....'); alert(err); } } fixpositionscreen(); ``` @r4-2017, you can use the [`onchange`](https://w3c.github.io/screen-orientation/#dom-screenorientation-onchange) event handler to monitor actual orientation change. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/screen-orientation/issues/123#issuecomment-438538751
Received on Wednesday, 14 November 2018 05:05:03 UTC