- missing account color and balance
- revoking permission on account change
- UI errors on message signing modal
This commit is contained in:
Richard Ramos 2021-11-18 19:40:49 -04:00
parent f9b08abd72
commit a9a5469f72
8 changed files with 36 additions and 32 deletions

View File

@ -32,27 +32,27 @@ QtObject:
QtProperty[string] address:
read = address
proc iconColor*(self: AccountItemView): string {.slot.} = result = ?.self.account.iconColor
QtProperty[string] iconColor:
read = iconColor
proc color*(self: AccountItemView): string {.slot.} = result = ?.self.account.iconColor
QtProperty[string] color:
read = color
proc balance*(self: AccountItemView): string {.slot.} =
proc currentBalance*(self: AccountItemView): string {.slot.} =
if ?.self.account.balance.isSome:
result = ?.self.account.balance.get()
else:
result = ""
QtProperty[string] balance:
read = balance
QtProperty[string] currentBalance:
read = currentBalance
proc fiatBalance*(self: AccountItemView): string {.slot.} =
proc currencyBalance*(self: AccountItemView): string {.slot.} =
if ?.self.account.realFiatBalance.isSome:
result = fmt"{?.self.account.realFiatBalance.get():>.2f}"
else:
result = ""
QtProperty[string] fiatBalance:
read = fiatBalance
QtProperty[string] currencyBalance:
read = currencyBalance
proc path*(self: AccountItemView): string {.slot.} = result = ?.self.account.path
QtProperty[string] path:

View File

@ -45,11 +45,11 @@ QtObject:
case column:
of "name": result = account.name
of "address": result = account.address
of "iconColor": result = account.iconColor
of "color": result = account.iconColor
of "balance": result = if account.balance.isSome(): account.balance.get() else: "..."
of "path": result = account.path
of "walletType": result = account.walletType
of "fiatBalance": result = if account.realFiatBalance.isSome(): fmt"{account.realFiatBalance.get():>.2f}" else: "..."
of "currencyBalance": result = if account.realFiatBalance.isSome(): fmt"{account.realFiatBalance.get():>.2f}" else: "..."
proc getAccountindexByAddress*(self: AccountList, address: string): int =
var i = 0
@ -102,9 +102,9 @@ QtObject:
method roleNames(self: AccountList): Table[int, string] =
{ AccountRoles.Name.int:"name",
AccountRoles.Address.int:"address",
AccountRoles.Color.int:"iconColor",
AccountRoles.Color.int:"color",
AccountRoles.Balance.int:"balance",
AccountRoles.FiatBalance.int:"fiatBalance",
AccountRoles.FiatBalance.int:"currencyBalance",
AccountRoles.Assets.int:"assets",
AccountRoles.Wallet.int:"isWallet",
AccountRoles.WalletType.int:"walletType",

View File

@ -159,7 +159,7 @@ Rectangle {
favoriteComponent: favoritesBar
currentFavorite: currentWebView && BookmarksStore.getCurrentFavorite(currentWebView.url)
dappBrowserAccName: WalletStore.dappBrowserAccount.name
dappBrowserAccIcon: WalletStore.dappBrowserAccount.iconColor
dappBrowserAccIcon: WalletStore.dappBrowserAccount.color
onAddNewFavoritelClicked: {
addFavoriteModal.modifiyModal = browserHeader.currentFavorite
addFavoriteModal.toolbarMode = true

View File

@ -46,14 +46,13 @@ Popup {
}
ColumnLayout {
anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding
anchors.right: parent.right
anchors.rightMargin: Style.current.smallPadding
spacing: Style.current.bigPadding
anchors.top: parent.top
anchors.left: root.left
anchors.leftMargin: Style.current.padding
anchors.right: root.right
anchors.rightMargin: Style.current.padding
anchors.top: root.top
anchors.topMargin: 90
RowLayout {
property int imgSize: 40
@ -137,8 +136,9 @@ Popup {
root.currentAddress = selectedAccount.address
Web3ProviderStore.web3ProviderInst.dappsAddress = selectedAccount.address;
Web3ProviderStore.web3ProviderInst.clearPermissions();
if (selectField.menu.currentIndex !== -1) {
Web3ProviderStore.revokeAllPermissions()
if (selectedAccount.address) {
Web3ProviderStore.web3ProviderInst.dappsAddress = selectedAccount.address;
WalletStore.setDappBrowserAddress()
}

View File

@ -131,7 +131,7 @@ Popup {
accountSelectorRow.currentAddress = selectedAccount.address
Web3ProviderStore.web3ProviderInst.dappsAddress = selectedAccount.address;
WalletStore.setDappBrowserAddress()
Web3ProviderStore.web3ProviderInst.clearPermissions();
Web3ProviderStore.revokeAllPermissions();
for (let i = 0; i < tabs.count; ++i){
tabs.getTab(i).item.reload();
}

View File

@ -80,7 +80,6 @@ StatusModal {
contentItem: Item {
width: root.width
height: childrenRect.height
TransactionSigner {
id: transactionSigner
@ -91,9 +90,10 @@ StatusModal {
Column {
id: content
anchors.left: parent.left
anchors.right: parent.right
visible: !showSigningPhrase
width: root.width - Style.current.padding * 2
anchors.left: parent.left
anchors.leftMargin: Style.current.padding
LabelValueRow {
//% "From"
@ -209,16 +209,17 @@ StatusModal {
}
rightButtons: [
leftButtons: [
StatusFlatButton {
id: btnReject
//% "Reject"
text: qsTrId("reject")
color: Style.current.danger
type: StatusBaseButton.Type.Danger
onClicked: close()
},
}
]
rightButtons: [
StatusButton {
id: btnNext
text: showSigningPhrase ?

View File

@ -10,6 +10,10 @@ QtObject {
property int networkId: providerModule.networkId
function revokeAllPermissions(){
dappPermissionsModule.revokeAllPermissions()
}
function determineRealURL(text){
var url = RootStore.getUrlFromUserInput(text);
var host = providerModule.getHost(url);

View File

@ -89,7 +89,7 @@ StatusModal {
initialItem: groupPreview
isLastGroup: stack.currentGroup === groupSignTx
onGroupActivated: {
root.title = group.headerText
header.title = group.headerText
btnNext.text = group.footerText
}
TransactionFormGroup {
@ -282,7 +282,6 @@ StatusModal {
rightButtons: [
StatusButton {
id: btnNext
anchors.right: parent.right
//% "Next"
text: qsTrId("next")
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending