1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Prevent conflicting values when network change and QR code in same render

This commit is contained in:
David Walsh 2020-10-22 10:08:54 -05:00
parent cdef338c85
commit 9c25775b69

View File

@ -66,14 +66,17 @@ export default class EnsInput extends Component {
let newValue
// Set the value of our input based on QR code provided by parent
if (input !== value && prevProps.value !== value) {
const newProvidedValue = input !== value && prevProps.value !== value
if (newProvidedValue) {
newValue = value
}
if (prevProps.network !== network) {
const provider = global.ethereumProvider
this.ens = new ENS({ provider, network })
newValue = input
if (!newProvidedValue) {
newValue = input
}
}
if (newValue !== undefined) {