mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-21 23:04:53 +00:00
Fix potential init bug in js interface
This commit is contained in:
parent
891fa51cb2
commit
4b31ee3097
@ -339,9 +339,13 @@ exports.mergeWithDefaults = function (options) {
|
|||||||
*/
|
*/
|
||||||
exports.pluginInitialize = function () {
|
exports.pluginInitialize = function () {
|
||||||
this._isAndroid = device.platform.match(/^android|amazon/i) !== null;
|
this._isAndroid = device.platform.match(/^android|amazon/i) !== null;
|
||||||
this._isEnabled = this._isEnabled || device.platform == 'browser';
|
|
||||||
this._isActive = this._isActive || device.platform == 'browser';
|
|
||||||
this.setDefaults({});
|
this.setDefaults({});
|
||||||
|
|
||||||
|
if (device.platform == 'browser' || window.webkit !== undefined) {
|
||||||
|
this.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._isActive = this._isActive || device.platform == 'browser';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -354,7 +358,7 @@ exports.pluginInitialize = function () {
|
|||||||
*
|
*
|
||||||
* Flag indicates if the mode is enabled.
|
* Flag indicates if the mode is enabled.
|
||||||
*/
|
*/
|
||||||
exports._isEnabled = window.webkit !== undefined;
|
exports._isEnabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
Loading…
Reference in New Issue
Block a user