qml: update history view after address/key delete. fixes #8782
This commit is contained in:
@@ -150,4 +150,11 @@ Pane {
|
||||
listview.positionViewAtBeginning()
|
||||
}
|
||||
}
|
||||
|
||||
StackView.onVisibleChanged: {
|
||||
// refresh model if History becomes visible and the model is dirty.
|
||||
if (StackView.visible) {
|
||||
Daemon.currentWallet.historyModel.initModel(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,7 @@ class QEAddressDetails(AuthMixin, QObject):
|
||||
assert self.canDelete
|
||||
try:
|
||||
self._wallet.wallet.delete_address(self._address)
|
||||
self._wallet.historyModel.setDirty()
|
||||
except UserFacingException as e:
|
||||
self.addressDeleteFailed.emit(str(e))
|
||||
return False
|
||||
|
||||
@@ -196,10 +196,12 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
|
||||
|
||||
@qt_event_listener
|
||||
def on_event_removed_transaction(self, wallet, tx):
|
||||
# NOTE: this event only triggers once, only for the first deleted tx, when for imported wallets an address
|
||||
# is deleted along with multiple associated txs
|
||||
if wallet == self.wallet:
|
||||
self._logger.info(f'removed transaction {tx.txid()}')
|
||||
self.addressCoinModel.setDirty()
|
||||
self.historyModel.initModel(True) # setDirty()?
|
||||
self.historyModel.setDirty()
|
||||
self.balanceChanged.emit()
|
||||
|
||||
@qt_event_listener
|
||||
|
||||
Reference in New Issue
Block a user