1
0

qml: update history view after address/key delete. fixes #8782

This commit is contained in:
Sander van Grieken
2024-01-18 00:25:25 +01:00
parent ef9ba0985e
commit 55a2005a6b
3 changed files with 11 additions and 1 deletions

View File

@@ -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)
}
}
}

View File

@@ -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

View File

@@ -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