Skip to content

Commit

Permalink
fix(secure-storage): import getPromise
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsogl committed Sep 24, 2018
1 parent e661f2e commit 653f5a2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/@ionic-native/plugins/secure-storage/index.ts
@@ -1,13 +1,11 @@
import { Injectable } from '@angular/core';
import { CordovaCheck, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { CordovaCheck, CordovaInstance, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core';

/**
* @hidden
*/
export class SecureStorageObject {

constructor(private _objectInstance: any) {
}
constructor(private _objectInstance: any) {}

/**
* Gets a stored item
Expand Down Expand Up @@ -76,7 +74,6 @@ export class SecureStorageObject {
secureDevice(): Promise<any> {
return;
}

}

/**
Expand Down Expand Up @@ -134,7 +131,6 @@ export class SecureStorageObject {
})
@Injectable()
export class SecureStorage extends IonicNativePlugin {

/**
* Creates a namespaced storage.
* @param store {string}
Expand All @@ -143,8 +139,11 @@ export class SecureStorage extends IonicNativePlugin {
@CordovaCheck()
create(store: string): Promise<SecureStorageObject> {
return getPromise<SecureStorageObject>((res: Function, rej: Function) => {
const instance = new (SecureStorage.getPlugin())(() => res(new SecureStorageObject(instance)), rej, store);
const instance = new (SecureStorage.getPlugin())(
() => res(new SecureStorageObject(instance)),
rej,
store
);
});
}

}

0 comments on commit 653f5a2

Please sign in to comment.