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: QtProperty[QVariant] utilsView:
read = getUtils read = getUtils
proc getDappBrowserView(self: WalletView): QVariant {.slot.} = newQVariant(self.dappBrowserView)
QtProperty[QVariant] dappBrowserView:
read = getDappBrowserView
proc updateView*(self: WalletView) = proc updateView*(self: WalletView) =
self.balanceView.setTotalFiatBalance(self.status.wallet.getTotalFiatBalance()) self.balanceView.setTotalFiatBalance(self.status.wallet.getTotalFiatBalance())
self.balanceView.totalFiatBalanceChanged() self.balanceView.totalFiatBalanceChanged()

View File

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

View File

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

View File

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

View File

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