Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
['@babel/preset-env', { targets: '> 3%, not dead' }],
'@babel/preset-typescript',
'@babel/preset-react',
],
Expand Down
7 changes: 6 additions & 1 deletion src/inputs/AddressInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ function AddressInput({

// when user switch the network we update the address state
useEffect(() => {
updateAddressState(inputRef.current?.value);
// Because the `address` is going to change after we call `updateAddressState`
// To avoid calling `updateAddressState` twice, we check the value and the current address
const inputValue = inputRef.current?.value;
if (inputValue !== address) {
updateAddressState(inputRef.current?.value);
}
}, [networkPrefix, address, updateAddressState]);

// when user types we update the address state
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@ module.exports = {
fs: 'empty',
child_process: 'empty',
},
optimization: {
minimize: false,
},
};