From aed3b310d94b57617f564ab4c97bdc5010196a42 Mon Sep 17 00:00:00 2001 From: Ken Sodemann Date: Mon, 12 Jul 2021 17:24:06 -0500 Subject: [PATCH] fix(secure-storage): modify the driver check The prior check that was there had a chick/egg problem with checking the driver used for the database before the database was created. --- lib/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/index.ts b/lib/src/index.ts index 986a83a..aae7c10 100644 --- a/lib/src/index.ts +++ b/lib/src/index.ts @@ -159,10 +159,10 @@ export class Storage { } setEncryptionKey(key: string) { - if (this.driver !== 'ionicSecureStorage') { + if (!this._secureStorageDriver) { throw new Error('@ionic-enterprise/secure-storage not installed. Encryption support not available'); } else { (this._secureStorageDriver as any)?.setEncryptionKey(key); } } -} \ No newline at end of file +}