do those functions need to be in that RSVP.Promise ?
or could those be general functions that return a Promise that resolves the ethProvider?
something like:
```js
getEthProvider: function() {
if (window.ethereum) {
return window.ethereum.enable().then(() => {
return instantiateWithAccount(...)
})
}
}
```
raucao
(Migrated from github.com)
reviewed 2019-04-04 10:43:41 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
closes #87
@@ -58,0 +50,4 @@console.debug('[kredits] Using user-provided instance, e.g. from Mist browser or Metamask');ethProvider = new ethers.providers.Web3Provider(web3.currentProvider);ethProvider.listAccounts().then(accounts => {context.set('currentUserAccounts', accounts);do those functions need to be in that RSVP.Promise ?
or could those be general functions that return a Promise that resolves the ethProvider?
something like:
@@ -58,0 +50,4 @@console.debug('[kredits] Using user-provided instance, e.g. from Mist browser or Metamask');ethProvider = new ethers.providers.Web3Provider(web3.currentProvider);ethProvider.listAccounts().then(accounts => {context.set('currentUserAccounts', accounts);It's easier this way. Anyone wanting to refactor it more can do so in the future. PRs welcome.