mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Modify logic for component update.
This commit is contained in:
parent
43e28788d7
commit
7a466697d3
@ -15,7 +15,7 @@ function Mascot () {
|
|||||||
width: 200,
|
width: 200,
|
||||||
height: 200,
|
height: 200,
|
||||||
})
|
})
|
||||||
if (!this.logo) return
|
if (!this.logo.webGLSupport) return
|
||||||
this.refollowMouse = debounce(this.logo.setFollowMouse.bind(this.logo, true), 1000)
|
this.refollowMouse = debounce(this.logo.setFollowMouse.bind(this.logo, true), 1000)
|
||||||
this.unfollowMouse = this.logo.setFollowMouse.bind(this.logo, false)
|
this.unfollowMouse = this.logo.setFollowMouse.bind(this.logo, false)
|
||||||
}
|
}
|
||||||
@ -36,10 +36,9 @@ Mascot.prototype.render = function () {
|
|||||||
Mascot.prototype.componentDidMount = function () {
|
Mascot.prototype.componentDidMount = function () {
|
||||||
var targetDivId = 'metamask-mascot-container'
|
var targetDivId = 'metamask-mascot-container'
|
||||||
var container = document.getElementById(targetDivId)
|
var container = document.getElementById(targetDivId)
|
||||||
if (!this.logo) {
|
if (!this.logo.webGLSupport) {
|
||||||
var staticLogo = document.createElement('img')
|
var staticLogo = this.logo.staticLogo
|
||||||
staticLogo.src = 'images/icon-128.png'
|
staticLogo.style.marginBottom = '40px'
|
||||||
staticLogo.style.marginBottom = '20px'
|
|
||||||
container.appendChild(staticLogo)
|
container.appendChild(staticLogo)
|
||||||
} else {
|
} else {
|
||||||
container.appendChild(this.logo.canvas)
|
container.appendChild(this.logo.canvas)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user