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) {
|
||||
if (screenObject.nativeLock != null) {
|
||||
promiseLock = screenObject.nativeLock(orientation);
|
||||
} else {
|
||||
resolveOrientation(orientation, resolve, reject);
|
||||
}
|
||||
promiseLock.then(function success(res) {
|
||||
resolve();
|
||||
}, function error(err) {
|
||||
screenObject.nativeLock = null;
|
||||
resolveOrientation(orientation, resolve, reject);
|
||||
});
|
||||
} else {
|
||||
resolveOrientation(orientation, resolve, reject);
|
||||
}
|
||||
})
|
||||
return p;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user