Skip to content

Commit

Permalink
added code for select providers with same id
Browse files Browse the repository at this point in the history
  • Loading branch information
donskov committed May 28, 2018
1 parent 35be5c0 commit 0a77f90
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/sagas/crypto/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,16 @@ function* providerSelect({ id }) {
try {
const state = yield select();
const providers = state.find('providers');
const provider = providers.where({ id }).get();
let provider = providers.where({ id }).get();

if (Array.isArray(provider)) {
provider = provider[0];
}

if (!provider.logged) {
yield put(WSActions.login(provider.id));
console.warn('yield put(WSActions.login(provider.id));');
}

if (!provider.loaded && provider.logged) {
yield getProviderCertificates();
yield put(ItemActions.select());
Expand Down Expand Up @@ -237,7 +242,6 @@ function* webcryptoOnListening() {
* }}
*/
function* providerLogin({ id }) {
console.warn('providerLogin');
try {
const crypto = yield Provider.cryptoGet(id);
const isLogged = yield Provider.providerIsLogged(crypto);
Expand All @@ -251,7 +255,6 @@ function* providerLogin({ id }) {
yield put(ItemActions.select());
yield put(ProviderActions.update({ loaded: true }));
}
console.warn('put ProviderActions.update({ logged })');
} else {
yield getProviderCertificates();
yield put(ItemActions.select());
Expand Down

0 comments on commit 0a77f90

Please sign in to comment.