qml: close TxDetails on TX remove only after the 'removed_transaction' event has been received, so the
history model doesn't refresh too early (fixes #8782)
This commit is contained in:
@@ -473,10 +473,13 @@ Pane {
|
|||||||
var dialog = app.messageDialog.createObject(app, { text: message, yesno: true })
|
var dialog = app.messageDialog.createObject(app, { text: message, yesno: true })
|
||||||
dialog.accepted.connect(function() {
|
dialog.accepted.connect(function() {
|
||||||
txdetails.removeLocalTx(true)
|
txdetails.removeLocalTx(true)
|
||||||
root.close()
|
root.enabled = false
|
||||||
})
|
})
|
||||||
dialog.open()
|
dialog.open()
|
||||||
}
|
}
|
||||||
|
onTxRemoved: {
|
||||||
|
root.close()
|
||||||
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (root.txid) {
|
if (root.txid) {
|
||||||
txdetails.txid = root.txid
|
txdetails.txid = root.txid
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class QETxDetails(QObject, QtEventListener):
|
|||||||
_logger = get_logger(__name__)
|
_logger = get_logger(__name__)
|
||||||
|
|
||||||
confirmRemoveLocalTx = pyqtSignal([str], arguments=['message'])
|
confirmRemoveLocalTx = pyqtSignal([str], arguments=['message'])
|
||||||
|
txRemoved = pyqtSignal()
|
||||||
saveTxError = pyqtSignal([str,str], arguments=['code', 'message'])
|
saveTxError = pyqtSignal([str,str], arguments=['code', 'message'])
|
||||||
saveTxSuccess = pyqtSignal()
|
saveTxSuccess = pyqtSignal()
|
||||||
|
|
||||||
@@ -83,6 +84,12 @@ class QETxDetails(QObject, QtEventListener):
|
|||||||
self._logger.debug(f'new_transaction event for our txid {self._txid}')
|
self._logger.debug(f'new_transaction event for our txid {self._txid}')
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
@event_listener
|
||||||
|
def on_event_removed_transaction(self, wallet, tx):
|
||||||
|
if wallet == self._wallet.wallet and tx.txid() == self._txid:
|
||||||
|
self._logger.debug(f'removed my transaction {tx.txid()}')
|
||||||
|
self.txRemoved.emit()
|
||||||
|
|
||||||
walletChanged = pyqtSignal()
|
walletChanged = pyqtSignal()
|
||||||
@pyqtProperty(QEWallet, notify=walletChanged)
|
@pyqtProperty(QEWallet, notify=walletChanged)
|
||||||
def wallet(self):
|
def wallet(self):
|
||||||
@@ -426,7 +433,7 @@ class QETxDetails(QObject, QtEventListener):
|
|||||||
self._can_broadcast = False
|
self._can_broadcast = False
|
||||||
self.detailsChanged.emit()
|
self.detailsChanged.emit()
|
||||||
|
|
||||||
@pyqtSlot(str,str,str)
|
@pyqtSlot(str, str, str)
|
||||||
def onBroadcastFailed(self, txid, code, reason):
|
def onBroadcastFailed(self, txid, code, reason):
|
||||||
if txid != self._txid:
|
if txid != self._txid:
|
||||||
return
|
return
|
||||||
@@ -461,7 +468,6 @@ class QETxDetails(QObject, QtEventListener):
|
|||||||
|
|
||||||
# NOTE: from here, the tx/txid is unknown and all properties are invalid.
|
# NOTE: from here, the tx/txid is unknown and all properties are invalid.
|
||||||
# UI should close TxDetails and avoid interacting with this qetxdetails instance.
|
# UI should close TxDetails and avoid interacting with this qetxdetails instance.
|
||||||
self._txid = None
|
|
||||||
self._tx = None
|
self._tx = None
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
|
|||||||
Reference in New Issue
Block a user