From 40e00c06021efb7ee3f05f53eb82dd2c306977f3 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Thu, 15 Feb 2024 09:37:03 +0100 Subject: [PATCH] fix(@wallet): Sepolia toggle --- .../wallet/networks/module.nim | 1 + .../AppLayouts/Profile/views/AdvancedView.qml | 24 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/app/modules/main/profile_section/wallet/networks/module.nim b/src/app/modules/main/profile_section/wallet/networks/module.nim index 6d99588b6e..5122355bc5 100644 --- a/src/app/modules/main/profile_section/wallet/networks/module.nim +++ b/src/app/modules/main/profile_section/wallet/networks/module.nim @@ -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 = diff --git a/ui/app/AppLayouts/Profile/views/AdvancedView.qml b/ui/app/AppLayouts/Profile/views/AdvancedView.qml index fa13022b99..cb9d8dd261 100644 --- a/ui/app/AppLayouts/Profile/views/AdvancedView.qml +++ b/ui/app/AppLayouts/Profile/views/AdvancedView.qml @@ -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 {