mirror of
https://github.com/apache/cordova-plugin-screen-orientation.git
synced 2025-05-05 01:32:59 +08:00
puts all nativelock handling together
This commit is contained in:
parent
050cc069a1
commit
68693cf017
@ -56,15 +56,15 @@
|
|||||||
var p = new Promise(function(resolve, reject) {
|
var p = new Promise(function(resolve, reject) {
|
||||||
if (screenObject.nativeLock != null) {
|
if (screenObject.nativeLock != null) {
|
||||||
promiseLock = screenObject.nativeLock(orientation);
|
promiseLock = screenObject.nativeLock(orientation);
|
||||||
} else {
|
|
||||||
resolveOrientation(orientation, resolve, reject);
|
|
||||||
}
|
|
||||||
promiseLock.then(function success(res) {
|
promiseLock.then(function success(res) {
|
||||||
resolve();
|
resolve();
|
||||||
}, function error(err) {
|
}, function error(err) {
|
||||||
screenObject.nativeLock = null;
|
screenObject.nativeLock = null;
|
||||||
resolveOrientation(orientation, resolve, reject);
|
resolveOrientation(orientation, resolve, reject);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
resolveOrientation(orientation, resolve, reject);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user