Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed undefined global in the Browser in indexed-store/index.js #48

Merged
merged 6 commits into from
May 10, 2020

Conversation

clibu
Copy link
Contributor

@clibu clibu commented May 6, 2020

See commit message.

clibu added 2 commits April 29, 2020 13:46
As per Gitter post with Andrey
Function in this module that use ``global`` would raise an exception because it is undefined in the Browser. ex. ``clean()`` & ``db.onversionchange()``
indexed-store/index.js Outdated Show resolved Hide resolved
@clibu
Copy link
Contributor Author

clibu commented May 7, 2020

Yep. I'm fine with your change. I've made that change in my fork but can't do a pull request!
Ok now I see my pull request is here. My bad.

@ai
Copy link
Member

ai commented May 7, 2020

Just add new commits to your master branch and push it to the GitHub. GitHub will update the pull request.

@clibu
Copy link
Contributor Author

clibu commented May 7, 2020

Looks like you have the new commit now.

@ai
Copy link
Member

ai commented May 7, 2020

Yeap, but I do not see changes for

https://github.com/clibu/client/blob/16f790f56c55a7e4adde19a7029b197b1b6ebcd0/indexed-store/index.js#L74
https://github.com/clibu/client/blob/16f790f56c55a7e4adde19a7029b197b1b6ebcd0/indexed-store/index.js#L270

Also, I recommend to install dependencies and run linter. It will tell you what to fix:

yarn install
yarn test

@clibu
Copy link
Contributor Author

clibu commented May 7, 2020

Ok, so is this what you are thinking:

const _global = ( typeof document !== 'undefined' && !global ) ? window : global

and

    await promisify(_global.indexedDB.deleteDatabase(store.name))

etc.

@ai
Copy link
Member

ai commented May 7, 2020

Yeap, I like it!

clibu added 3 commits May 7, 2020 11:46
/home/travis/build/logux/client/indexed-store/index.js
  3:1   error  This line has a length of 135. Maximum allowed is 80  max-len
  3:18  error  There should be no space after this paren             space-in-parens
  3:61  error  There should be no space before this paren            space-in-parens
  3:81  error  Multiple spaces found before '// global is u...'      no-multi-spaces
 4:1   error  This line has a length of 82. Maximum allowed is 80  max-len
  4:79  error  Trailing spaces not allowed                          no-trailing-spaces
@ai ai merged commit b5f1870 into logux:master May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants