mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:32:52 +08:00
fix(secure-storage): reject the promise if the plugin doesn't exist (#1562)
This commit is contained in:
parent
4c8deb2bed
commit
d5919d1736
@ -8,7 +8,7 @@ declare var cordova: any;
|
||||
*/
|
||||
export class SecureStorageObject {
|
||||
|
||||
constructor(private _objectInstance?: any) { }
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
/**
|
||||
* Gets a stored item
|
||||
@ -125,7 +125,7 @@ export class SecureStorage extends IonicNativePlugin {
|
||||
if (checkAvailability('cordova.plugins.SecureStorage', null, 'SecureStorage') === true) {
|
||||
const instance = new cordova.plugins.SecureStorage(() => res(new SecureStorageObject(instance)), rej, store);
|
||||
} else {
|
||||
res(new SecureStorageObject());
|
||||
rej('SecureStorage failure: cordova plugin is not available');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user