diff --git a/electrum/gui/qml/components/Swap.qml b/electrum/gui/qml/components/Swap.qml index 9a6532256..3879c6d0f 100644 --- a/electrum/gui/qml/components/Swap.qml +++ b/electrum/gui/qml/components/Swap.qml @@ -181,25 +181,8 @@ Dialog { }) dialog.open() } - onAuthRequired: { // TODO: don't replicate this code - if (swaphelper.wallet.verify_password('')) { - // wallet has no password - console.log('wallet has no password, proceeding') - swaphelper.authProceed() - } else { - var dialog = app.passwordDialog.createObject(app, {'title': qsTr('Enter current password')}) - dialog.accepted.connect(function() { - if (swaphelper.wallet.verify_password(dialog.password)) { - swaphelper.wallet.authProceed() - } else { - swaphelper.wallet.authCancel() - } - }) - dialog.rejected.connect(function() { - swaphelper.wallet.authCancel() - }) - dialog.open() - } + onAuthRequired: { + app.handleAuthRequired(swaphelper, method) } } } diff --git a/electrum/gui/qml/qeswaphelper.py b/electrum/gui/qml/qeswaphelper.py index e7cc22ae3..d2b0d9fc8 100644 --- a/electrum/gui/qml/qeswaphelper.py +++ b/electrum/gui/qml/qeswaphelper.py @@ -262,7 +262,7 @@ class QESwapHelper(AuthMixin, QObject): # fee breakdown self.serverfeeperc = f'{swap_manager.percentage:0.1f}%' self.serverfee = QEAmount(amount_sat=swap_manager.normal_fee) - self.miningfee = QEAmount(amount_sat=self._tx.get_fee()) + self.miningfee = QEAmount(amount_sat=self._tx.get_fee()) if self._tx else QEAmount() if pay_amount and receive_amount: self.valid = True