fix(@browser): Fix etherscan link

fixes #4786
fixes #5014

also fixed simpledapp.eth due to need to resolve previous issue
This commit is contained in:
Anthony Laibe 2022-03-15 15:40:16 +01:00 committed by Anthony Laibe
parent a910a3e801
commit 6e453dbbba
3 changed files with 15 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import NimQml
import NimQml, strutils
import ./io_interface
@ -61,4 +61,11 @@ QtObject:
proc ensResourceURL*(self: View, ens: string, url: string): string {.slot.} =
let (url, base, http_scheme, path_prefix, hasContentHash) = self.delegate.ensResourceURL(ens, url)
result = url_replaceHostAndAddPath(url, (if hasContentHash: base else: url_host(base)), http_scheme, path_prefix)
var newHost = url_host(base)
if hasContentHash:
if strutils.endsWith(base, "/"):
newHost = base[.. ^2]
else:
newHost = base
result = url_replaceHostAndAddPath(url, newHost, http_scheme, "")

View File

@ -199,7 +199,7 @@ Rectangle {
toastMessage.source = Style.svg("loading")
toastMessage.iconColor = Style.current.primary
toastMessage.iconRotates = true
toastMessage.link = `${WalletStore.etherscanLink}/${result}`
toastMessage.link = `${WalletStore.getEtherscanLink()}/${result}`
toastMessage.open()
}
}

View File

@ -10,7 +10,11 @@ QtObject {
property string defaultCurrency: walletSection.currentCurrency
property string signingPhrase: walletSection.signingPhrase
// Not Refactored Yet
property string etherscanString: ""// walletModel.utilsView.etherscanLink
function getEtherscanLink() {
return profileSectionModule.ensUsernamesModule.getEtherscanLink()
}
function setDappBrowserAddress() {
// Not Refactored Yet