Skip to content

Commit b20f944

Browse files
committed
fix(Settings): unbreak the NetworksView size
- fixes the empty networks view under Settings/Wallet/Networks - minor cleanups + silence some warnings Fixes #18963
1 parent 357c9e1 commit b20f944

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

storybook/pages/NetworksViewPage.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ SplitView {
4949
flatNetworks: d.networksModel
5050
areTestNetworksEnabled: testModeCheckBox.checked
5151

52-
onEditNetwork: {
52+
onEditNetwork: function (chainId) {
5353
console.log("Edit network", chainId)
5454
}
55-
onSetNetworkActive: {
55+
onSetNetworkActive: function (chainId, active) {
5656
console.log("Set network active test networks", chainId, active)
5757
const index = ModelUtils.indexOf(d.networksModel, "chainId", chainId)
5858
d.networksModel.setProperty(index, "isActive", active)

ui/app/AppLayouts/Profile/views/WalletView.qml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import QtCore
22
import QtQml
33
import QtQuick
44

5-
import Qt5Compat.GraphicalEffects
65
import QtQuick.Controls
76
import QtQuick.Layouts
87

@@ -156,13 +155,11 @@ SettingsContentBase {
156155
Binding on currentIndex {
157156
value: root.manageTokensViewIndex
158157
when: priv.isManageTokensSubsection
159-
restoreMode: Binding.RestoreNone
160158
}
161159

162160
Binding on currentIndex {
163161
value: root.networksViewIndex
164-
when: root.settingsSubSubsection === Constants.walletSettingsSubsection.manageNetworks
165-
restoreMode: Binding.RestoreNone
162+
when: priv.isManageNetworksSubsection
166163
}
167164

168165
onCurrentIndexChanged: {
@@ -174,42 +171,40 @@ SettingsContentBase {
174171
root.stickTitleRowComponentLoader = false
175172
root.titleLayout.spacing = 5
176173

177-
if (currentIndex == root.mainViewIndex) {
174+
if (currentIndex === root.mainViewIndex) {
178175
root.titleRowComponentLoader.sourceComponent = addNewAccountButtonComponent
179-
}
180176

181-
if(currentIndex == root.networksViewIndex) {
177+
} else if(currentIndex === root.networksViewIndex) {
182178
priv.backButtonName = root.walletSectionTitle
183179
root.sectionTitle = root.networksSectionTitle
184180

185181
root.titleRowComponentLoader.sourceComponent = toggleTestnetModeSwitchComponent
186-
}
187182

188-
if(currentIndex == root.editNetworksViewIndex) {
183+
} else if(currentIndex === root.editNetworksViewIndex) {
189184
priv.backButtonName = root.networksSectionTitle
190185
root.sectionTitle = qsTr("Edit %1").arg(!!editNetwork.network &&
191186
!!editNetwork.network.chainName ? editNetwork.network.chainName: "")
192187
root.titleRowLeftComponentLoader.visible = true
193188
root.titleRowLeftComponentLoader.sourceComponent = networkIcon
194189
root.titleLayout.spacing = 12
195190

196-
} else if(currentIndex == root.accountViewIndex) {
191+
} else if(currentIndex === root.accountViewIndex) {
197192
priv.backButtonName = root.walletSectionTitle
198193
root.sectionTitle = ""
199194

200-
} else if(currentIndex == root.accountOrderViewIndex) {
195+
} else if(currentIndex === root.accountOrderViewIndex) {
201196
priv.backButtonName = root.walletSectionTitle
202197
root.sectionTitle = qsTr("Edit account order")
203198
root.titleRowComponentLoader.sourceComponent = experimentalTagComponent
204199
root.stickTitleRowComponentLoader = true
205200

206-
} else if(currentIndex == root.manageTokensViewIndex) {
201+
} else if(currentIndex === root.manageTokensViewIndex) {
207202
priv.backButtonName = root.walletSectionTitle
208203
root.titleRowLeftComponentLoader.visible = false
209204
root.sectionTitle = qsTr("Manage tokens")
210205
root.titleRowComponentLoader.sourceComponent = experimentalTagComponent
211206
root.stickTitleRowComponentLoader = true
212-
} else if(currentIndex == root.savedAddressesViewIndex) {
207+
} else if(currentIndex === root.savedAddressesViewIndex) {
213208
priv.backButtonName = root.walletSectionTitle
214209
root.titleRowLeftComponentLoader.visible = false
215210
root.sectionTitle = qsTr("Saved addresses")
@@ -275,7 +270,7 @@ SettingsContentBase {
275270
NetworksView {
276271
id: networksView
277272
Layout.fillWidth: true
278-
Layout.fillHeight: false
273+
Layout.fillHeight: true
279274

280275
flatNetworks: root.networksStore.allNetworks
281276
areTestNetworksEnabled: root.networksStore.areTestNetworksEnabled
@@ -302,10 +297,8 @@ SettingsContentBase {
302297
networkRPCChanged: root.networksStore.networkRPCChanged
303298
rpcProviders: root.networksStore.rpcProviders
304299
areTestNetworksEnabled: root.networksStore.areTestNetworksEnabled
305-
onEvaluateRpcEndPoint: root.networksStore.evaluateRpcEndPoint(url, isMainUrl)
306-
onUpdateNetworkValues: {
307-
root.networksStore.updateNetworkEndPointValues(chainId, newMainRpcInput, newFailoverRpcUrl)
308-
}
300+
onEvaluateRpcEndPoint: (url, isMainUrl) => root.networksStore.evaluateRpcEndPoint(url, isMainUrl)
301+
onUpdateNetworkValues: (chainId, newMainRpcInput, newFailoverRpcUrl) => root.networksStore.updateNetworkEndPointValues(chainId, newMainRpcInput, newFailoverRpcUrl)
309302
}
310303

311304
AccountOrderView {

ui/app/AppLayouts/Profile/views/wallet/NetworksView.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Item {
6262
sourceModel: root.flatNetworks
6363
filters: ValueFilter {
6464
roleName: "isTest"
65-
value: testModeViewTabBar.currentIndex == root.testnetTabIndex
65+
value: testModeViewTabBar.currentIndex === root.testnetTabIndex
6666
}
6767
}
6868

0 commit comments

Comments
 (0)