Skip to content

Commit

Permalink
v1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrouid committed Jan 7, 2020
1 parent acb65b7 commit 24787c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "connext-store",
"version": "1.1.3",
"version": "1.1.4",
"description": "Connext Store Module",
"scripts": {
"clean": "rm -rf lib",
Expand Down
8 changes: 6 additions & 2 deletions src/utils.ts
@@ -1,6 +1,6 @@
import { utils } from 'ethers'
import AsyncStorageWrapper from './asyncStorage'
import { StorageWrapper } from './types'
import AsyncStorageWrapper from './asyncStorage'
import LocalStorageWrapper from './localStorage'

export function arrayify (
Expand Down Expand Up @@ -49,7 +49,11 @@ export function isAsyncStorage (storage: any) {
const key = '__react_native_storage_test'
const promiseTest = storage.setItem(key, 'test')
storage.removeItem(key)
return !!(promiseTest && promiseTest.then)
return !!(
typeof promiseTest !== 'undefined' &&
typeof promiseTest.then !== 'undefined' &&
typeof storage.length === 'undefined'
)
}

export function wrapAsyncStorage (asyncStorage: any): StorageWrapper {
Expand Down

0 comments on commit 24787c8

Please sign in to comment.