mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix loading animation not showing on network change
This commit is contained in:
parent
79be956be9
commit
5a93ec0252
@ -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,45 +1,38 @@
|
||||
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)
|
||||
}
|
||||
|
||||
render () {
|
||||
return (
|
||||
h('.full-flex-height', {
|
||||
style: {
|
||||
left: '0px',
|
||||
zIndex: 50,
|
||||
position: 'absolute',
|
||||
flexDirection: 'column',
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
background: 'rgba(255, 255, 255, 0.8)',
|
||||
},
|
||||
}, [
|
||||
h('img', {
|
||||
src: 'images/loading.svg',
|
||||
}),
|
||||
|
||||
h('br'),
|
||||
|
||||
this.renderMessage(),
|
||||
])
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
inherits(LoadingIndicator, Component)
|
||||
module.exports = LoadingIndicator
|
||||
|
||||
function LoadingIndicator () {
|
||||
Component.call(this)
|
||||
}
|
||||
|
||||
LoadingIndicator.prototype.render = function () {
|
||||
const { isLoading, loadingMessage } = this.props
|
||||
|
||||
return (
|
||||
isLoading ? h('.full-flex-height', {
|
||||
style: {
|
||||
left: '0px',
|
||||
zIndex: 10,
|
||||
position: 'absolute',
|
||||
flexDirection: 'column',
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
background: 'rgba(255, 255, 255, 0.8)',
|
||||
},
|
||||
}, [
|
||||
h('img', {
|
||||
src: 'images/loading.svg',
|
||||
}),
|
||||
|
||||
h('br'),
|
||||
|
||||
showMessageIfAny(loadingMessage),
|
||||
]) : null
|
||||
)
|
||||
}
|
||||
|
||||
function showMessageIfAny (loadingMessage) {
|
||||
if (!loadingMessage) return null
|
||||
return h('span', loadingMessage)
|
||||
}
|
||||
|
@ -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…
Reference in New Issue
Block a user