Fixes signer errors throwing // MaterialUI Update errors too (#2867) (#2876)

This commit is contained in:
Nicolas Gotchac 2016-10-26 11:56:38 +02:00 committed by Jaco Greeff
parent 3cd724d056
commit c05430e25e
8 changed files with 34 additions and 20 deletions

View File

@ -93,21 +93,30 @@ export default class Ws extends JsonRpcBase {
}
_onMessage = (event) => {
const result = JSON.parse(event.data);
const { method, params, json, resolve, reject } = this._messages[result.id];
Logging.send(method, params, { json, result });
if (result.error) {
this.error(event.data);
reject(new Error(`${result.error.code}: ${result.error.message}`));
delete this._messages[result.id];
return;
// Event sent by Signer Broadcaster
if (event.data === 'new_message') {
return false;
}
resolve(result.result);
delete this._messages[result.id];
try {
const result = JSON.parse(event.data);
const { method, params, json, resolve, reject } = this._messages[result.id];
Logging.send(method, params, { json, result });
if (result.error) {
this.error(event.data);
reject(new Error(`${result.error.code}: ${result.error.message}`));
delete this._messages[result.id];
return;
}
resolve(result.result);
delete this._messages[result.id];
} catch (e) {
console.error('ws::_onMessage', event.data, e);
}
}
_send = (id) => {

View File

@ -24,7 +24,7 @@ export default class Loading extends Component {
render () {
return (
<div className={ styles.loading }>
<CircularProgress size={ 2 } />
<CircularProgress size={ 120 } thickness={ 7 } />
</div>
);
}

View File

@ -79,7 +79,7 @@ export default class Application extends Component {
</p>
</div>
) : (
<CircularProgress size={ 1 } />
<CircularProgress size={ 60 } />
) }
</div>
);

View File

@ -25,9 +25,11 @@ export default class Loading extends Component {
};
render () {
const size = (this.props.size || 2) * 60;
return (
<div className={ styles.loading }>
<CircularProgress size={ this.props.size || 2 } />
<CircularProgress size={ size } />
</div>
);
}

View File

@ -15,15 +15,17 @@
/* along with Parity. If not, see <http://www.gnu.org/licenses/>.
*/
.container {
flex: 1;
padding: 0em;
background: rgba(0, 0, 0, 0.8) !important;
}
.compact,
.padded {
background: rgba(0, 0, 0, 0.8) !important;
border-radius: 0 !important;
position: relative;
overflow: auto;
background-color: transparent !important;
}
.compact {

View File

@ -43,7 +43,7 @@
.expanded {
right: 16px;
width: 964px;
height: 288px;
height: 300px;
border-radius: 4px 4px 0 0;
overflow-y: auto;
display: flex;
@ -53,6 +53,7 @@
.expanded .content {
flex: 1;
overflow: auto;
display: flex;
}
.corner {

View File

@ -80,7 +80,7 @@ export default class TransactionFinished extends Component {
if (!chain || !fromBalance || !toBalance) {
return (
<div className={ `${styles.container} ${className}` }>
<CircularProgress size={ 1 } />
<CircularProgress size={ 60 } />
</div>
);
}

View File

@ -81,7 +81,7 @@ export default class TransactionPending extends Component {
if (!this.state.chain) {
return (
<div className={ `${styles.container} ${className}` }>
<CircularProgress size={ 1 } />
<CircularProgress size={ 60 } />
</div>
);
}