Fix loading animation not showing on network change

feature/default_network_editable
Alexander Tseung 7 years ago
parent 79be956be9
commit 5a93ec0252
  1. 3
      ui/app/app.js
  2. 2
      ui/app/components/buy-button-subview.js
  3. 33
      ui/app/components/loading.js
  4. 4
      ui/app/conf-tx.js

@ -137,8 +137,7 @@ App.prototype.render = function () {
h(AccountMenu),
h(Loading, {
isLoading: isLoading || isLoadingNetwork,
(isLoading || isLoadingNetwork) && h(Loading, {
loadingMessage: loadMessage,
}),

@ -87,7 +87,7 @@ BuyButtonSubview.prototype.headerSubview = function () {
left: '49vw',
},
}, [
h(Loading, { isLoading }),
isLoading && h(Loading),
]),
// account panel

@ -1,23 +1,18 @@
const inherits = require('util').inherits
const Component = require('react').Component
const { Component } = require('react')
const h = require('react-hyperscript')
class LoadingIndicator extends Component {
renderMessage () {
const { loadingMessage } = this.props
return loadingMessage && h('span', loadingMessage)
}
inherits(LoadingIndicator, Component)
module.exports = LoadingIndicator
function LoadingIndicator () {
Component.call(this)
}
LoadingIndicator.prototype.render = function () {
const { isLoading, loadingMessage } = this.props
render () {
return (
isLoading ? h('.full-flex-height', {
h('.full-flex-height', {
style: {
left: '0px',
zIndex: 10,
zIndex: 50,
position: 'absolute',
flexDirection: 'column',
display: 'flex',
@ -34,12 +29,10 @@ LoadingIndicator.prototype.render = function () {
h('br'),
showMessageIfAny(loadingMessage),
]) : null
this.renderMessage(),
])
)
}
}
function showMessageIfAny (loadingMessage) {
if (!loadingMessage) return null
return h('span', loadingMessage)
}
module.exports = LoadingIndicator

@ -84,7 +84,7 @@ ConfirmTxScreen.prototype.render = function () {
*/
log.info(`rendering a combined ${unconfTxList.length} unconf msg & txs`)
if (unconfTxList.length === 0) return h(Loading, { isLoading: true })
if (unconfTxList.length === 0) return h(Loading)
return currentTxView({
// Properties
@ -130,7 +130,7 @@ function currentTxView (opts) {
return h(PendingTypedMsg, opts)
}
}
return h(Loading, { isLoading: true })
return h(Loading)
}
ConfirmTxScreen.prototype.buyEth = function (address, event) {

Loading…
Cancel
Save