fix(@wallet): Sepolia toggle

This commit is contained in:
Anthony Laibe 2024-02-15 09:37:03 +01:00 committed by Anthony Laibe
parent dbd7937d8b
commit 40e00c0602
2 changed files with 22 additions and 3 deletions

View File

@ -81,6 +81,7 @@ method load*(self: Module) =
self.controller.init()
self.view.load()
self.view.setAreTestNetworksEnabled(self.controller.areTestNetworksEnabled())
self.view.setIsSepoliaEnabled(self.controller.isSepoliaEnabled())
self.refreshNetworks()
method isLoaded*(self: Module): bool =

View File

@ -406,9 +406,7 @@ SettingsContentBase {
text: qsTr("Enable Sepolia as Test Network")
isSwitch: true
switchChecked: root.advancedStore.isSepoliaEnabled
onClicked: {
root.advancedStore.toggleIsSepoliaEnabled()
}
onClicked: Global.openPopup(enableSepoliaConfirmationDialogComponent)
}
StatusSettingsLineButton {
@ -454,6 +452,26 @@ SettingsContentBase {
}
}
Component {
id: enableSepoliaConfirmationDialogComponent
ConfirmationDialog {
property bool mode: false
id: confirmDialog
destroyOnClose: true
showCancelButton: true
confirmationText: qsTr("Are you sure you want to toggle sepolia? The app will be restarted.")
onConfirmButtonClicked: {
root.advancedStore.toggleIsSepoliaEnabled()
close()
Qt.quit()
}
onCancelButtonClicked: {
close()
}
}
}
Component {
id: enableDeveloperFeaturesConfirmationDialogComponent
ConfirmationDialog {