Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Fix signer token updates (#3302)
Browse files Browse the repository at this point in the history
* Manual bump of package.json (recovery)

* Debug

* Simplify status connections
  • Loading branch information
jacogr authored and arkpar committed Nov 9, 2016
1 parent 016e9fd commit c5d0c00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
12 changes: 3 additions & 9 deletions js/src/redux/providers/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ export default class Status {
setTimeout(this._pollStatus, timeout);
};

const wasConnected = this._store.getState().nodeStatus.isConnected;
if (isConnected !== wasConnected) {
this._fetchEnode();
}

this._store.dispatch(statusCollection({ isConnected, isConnecting, needsToken, secureToken }));

if (!isConnected) {
Expand All @@ -111,8 +106,7 @@ export default class Status {
this._api.parity.netPort(),
this._api.parity.nodeName(),
this._api.parity.rpcSettings(),
this._api.eth.syncing(),
this._pollTraceMode()
this._api.eth.syncing()
])
.then(([clientVersion, coinbase, defaultExtraData, extraData, gasFloorTarget, hashrate, minGasPrice, netChain, netPeers, netPort, nodeName, rpcSettings, syncing, traceMode]) => {
const isTest = netChain === 'morden' || netChain === 'testnet';
Expand All @@ -134,12 +128,12 @@ export default class Status {
isTest,
traceMode
}));
nextTimeout();
})
.catch((error) => {
console.error('_pollStatus', error);
nextTimeout();
});

nextTimeout();
}

_pollLogs = () => {
Expand Down
4 changes: 2 additions & 2 deletions js/src/secureApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class SecureApi extends Api {
super(new Api.Transport.Ws(url, sysuiToken));

this._isConnecting = true;
this._connectState = 0;
this._connectState = sysuiToken === 'initial' ? 1 : 0;
this._needsToken = false;
this._dappsPort = 8080;
this._signerPort = 8180;
Expand Down Expand Up @@ -110,7 +110,7 @@ export default class SecureApi extends Api {
console.log('SecureApi:connectSuccess', this._transport.token);
}

updateToken (token, connectState) {
updateToken (token, connectState = 0) {
this._connectState = connectState;
this._transport.updateToken(token.replace(/[^a-zA-Z0-9]/g, ''));
this._followConnection();
Expand Down
2 changes: 1 addition & 1 deletion js/src/views/Connection/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class Connection extends Component {
const { api } = this.context;
const { token } = this.state;

api.updateToken(token);
api.updateToken(token, 0);
this.setState({ token: '', validToken: false });
}
}
Expand Down

0 comments on commit c5d0c00

Please sign in to comment.