fix(browser): fix browser undefined model

This commit is contained in:
Jonathan Rainville 2021-06-22 12:59:11 -04:00
parent 3c6b6f9e54
commit 702f52f6ed
5 changed files with 11 additions and 7 deletions

View File

@ -85,6 +85,10 @@ QtObject:
QtProperty[QVariant] utilsView:
read = getUtils
proc getDappBrowserView(self: WalletView): QVariant {.slot.} = newQVariant(self.dappBrowserView)
QtProperty[QVariant] dappBrowserView:
read = getDappBrowserView
proc updateView*(self: WalletView) =
self.balanceView.setTotalFiatBalance(self.status.wallet.getTotalFiatBalance())
self.balanceView.totalFiatBalanceChanged()

View File

@ -118,7 +118,7 @@ Popup {
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
showAccountDetails: false
accounts: walletModel.accountsView.accounts
selectedAccount: walletModel.dappBrowserAccount
selectedAccount: walletModel.dappBrowserView.dappBrowserAccount
currency: walletModel.balanceView.defaultCurrency
onSelectedAccountChanged: {
if (!root.currentAddress) {

View File

@ -226,8 +226,8 @@ Rectangle {
icon.source: "../../img/walletIcon.svg"
icon.width: 18
icon.height: 18
icon.color: walletModel.dappBrowserAccount.iconColor
text: walletModel.dappBrowserAccount.name
icon.color: walletModel.dappBrowserView.dappBrowserAccount.iconColor
text: walletModel.dappBrowserView.dappBrowserAccount.name
implicitHeight: 32
type: "secondary"
onClicked: {

View File

@ -164,7 +164,7 @@ property Component sendTransactionModalComponent: SignTransactionModal {}
}
} else if (request.type === Constants.web3SendAsyncReadOnly &&
request.payload.method === "eth_sendTransaction") {
var acc = walletModel.dappBrowserAccount
var acc = walletModel.dappBrowserView.dappBrowserAccount
const value = utilsModel.wei2Eth(request.payload.params[0].value, 18);
const sendDialog = sendTransactionModalComponent.createObject(browserWindow, {
trxData: request.payload.params[0].data || "",
@ -234,8 +234,8 @@ property Component sendTransactionModalComponent: SignTransactionModal {}
const signDialog = signMessageModalComponent.createObject(browserWindow, {
request,
selectedAccount: {
name: walletModel.dappBrowserAccount.name,
iconColor: walletModel.dappBrowserAccount.iconColor
name: walletModel.dappBrowserView.dappBrowserAccount.name,
iconColor: walletModel.dappBrowserView.dappBrowserAccount.iconColor
}
});
signDialog.web3Response = web3Response

View File

@ -110,7 +110,7 @@ Popup {
anchors.right: copyBtn.left
anchors.rightMargin: Style.current.padding
accounts: walletModel.accountsView.accounts
selectedAccount: walletModel.dappBrowserAccount
selectedAccount: walletModel.dappBrowserView.dappBrowserAccount
currency: walletModel.balanceView.defaultCurrency
onSelectedAccountChanged: {
if (!accountSelectorRow.currentAddress) {