Allow status updates on 2nd API instance

This commit is contained in:
Jaco Greeff 2017-04-21 16:03:50 +02:00
parent fcdd19e105
commit c044534d6a
6 changed files with 45 additions and 5 deletions

View File

@ -16,7 +16,7 @@
import { handleActions } from 'redux-actions'; import { handleActions } from 'redux-actions';
const initialState = {}; const initialState = null;
export default handleActions({ export default handleActions({
setApi (state, action) { setApi (state, action) {

View File

@ -63,8 +63,6 @@ export function personalAccountsInfo (accountsInfo) {
return (dispatch, getState) => { return (dispatch, getState) => {
const { api } = getState(); const { api } = getState();
console.log('_fetchOwners', api);
const _fetchOwners = Object const _fetchOwners = Object
.values(wallets) .values(wallets)
.map((wallet) => { .map((wallet) => {

View File

@ -49,6 +49,10 @@ export default class Status {
api.on('disconnected', this.stop, this); api.on('disconnected', this.stop, this);
this.updateApiStatus(); this.updateApiStatus();
if (api.isConnected) {
this.start();
}
} }
static instantiate (store, api) { static instantiate (store, api) {

View File

@ -41,13 +41,13 @@ export default function (api, browserHistory, forEmbed = false) {
const middleware = initMiddleware(api, browserHistory, forEmbed); const middleware = initMiddleware(api, browserHistory, forEmbed);
const store = applyMiddleware(...middleware)(storeCreation)(reducers); const store = applyMiddleware(...middleware)(storeCreation)(reducers);
store.dispatch(setApi(api));
BalancesProvider.instantiate(store, api); BalancesProvider.instantiate(store, api);
StatusProvider.instantiate(store, api); StatusProvider.instantiate(store, api);
new PersonalProvider(store, api).start(); new PersonalProvider(store, api).start();
new SignerProvider(store, api).start(); new SignerProvider(store, api).start();
store.dispatch(setApi(api));
store.dispatch(startCachingReverses()); store.dispatch(startCachingReverses());
store.dispatch(loadWallet(api)); store.dispatch(loadWallet(api));
store.dispatch(initRequests(api)); store.dispatch(initRequests(api));

View File

@ -0,0 +1,19 @@
{
"name": "@parity/view-home",
"description": "Parity default Home view",
"version": "0.0.0",
"main": "index.js",
"author": "Parity Team <admin@parity.io>",
"maintainers": [],
"contributors": [],
"license": "GPL-3.0",
"repository": {
"type": "git",
"url": "git+https://github.com/paritytech/parity.git"
},
"keywords": [],
"scripts": {},
"devDependencies": {},
"dependencies": {},
"peerDependencies": {}
}

View File

@ -0,0 +1,19 @@
{
"name": "@parity/view-status",
"description": "Parity default Status view",
"version": "0.0.0",
"main": "index.js",
"author": "Parity Team <admin@parity.io>",
"maintainers": [],
"contributors": [],
"license": "GPL-3.0",
"repository": {
"type": "git",
"url": "git+https://github.com/paritytech/parity.git"
},
"keywords": [],
"scripts": {},
"devDependencies": {},
"dependencies": {},
"peerDependencies": {}
}