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:
parent
cdef338c85
commit
9c25775b69
@ -66,14 +66,17 @@ export default class EnsInput extends Component {
|
|||||||
let newValue
|
let newValue
|
||||||
|
|
||||||
// Set the value of our input based on QR code provided by parent
|
// 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
|
newValue = value
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prevProps.network !== network) {
|
if (prevProps.network !== network) {
|
||||||
const provider = global.ethereumProvider
|
const provider = global.ethereumProvider
|
||||||
this.ens = new ENS({ provider, network })
|
this.ens = new ENS({ provider, network })
|
||||||
newValue = input
|
if (!newProvidedValue) {
|
||||||
|
newValue = input
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newValue !== undefined) {
|
if (newValue !== undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user