Create and reuse js function

pull/6642/head
Никита Поздняков 2 years ago
parent ec87839a20
commit 75ad5b449d
No known key found for this signature in database
GPG Key ID: F344106F9804FE5F
  1. 12
      apps/block_scout_web/assets/js/lib/smart_contract/functions.js

@ -96,19 +96,19 @@ const readWriteFunction = (element) => {
const container = $('[data-smart-contract-functions]')
if (container.length) {
getCurrentAccountPromise(window.web3 && window.web3.currentProvider).then((currentAccount) => {
loadFunctions(container, false, currentAccount)
}, () => {
loadFunctions(container, false, null)
})
getWalletAndLoadFunctions()
}
const customABIContainer = $('[data-smart-contract-functions-custom]')
if (customABIContainer.length) {
getWalletAndLoadFunctions()
}
function getWalletAndLoadFunctions () {
getCurrentAccountPromise(window.web3 && window.web3.currentProvider).then((currentAccount) => {
loadFunctions(container, false, currentAccount)
}, () => {
loadFunctions(container, true, null)
loadFunctions(container, false, null)
})
}

Loading…
Cancel
Save