Skip to content
Snippets Groups Projects
Commit 8c5c0da4 authored by Vincent Texier's avatar Vincent Texier
Browse files

[enh] tx history update button set to disable until update is done

parent 5a4b266b
No related branches found
No related tags found
No related merge requests found
...@@ -186,10 +186,13 @@ class TxHistoryController(QObject): ...@@ -186,10 +186,13 @@ class TxHistoryController(QObject):
Update tx history from network for the selected date period Update tx history from network for the selected date period
:return: :return:
""" """
self._logger.debug("Manually refresh tx history...") self._logger.debug("Manually update tx history...")
pubkey = self.model.connection.pubkey # disable update button
self.view.button_refresh.setDisabled(True)
pubkey = self.model.connection.pubkey
try:
( (
changed_tx, changed_tx,
new_tx, new_tx,
...@@ -203,7 +206,10 @@ class TxHistoryController(QObject): ...@@ -203,7 +206,10 @@ class TxHistoryController(QObject):
for tx in new_tx: for tx in new_tx:
self.model.app.new_transfer.emit(self.model.connection, tx) self.model.app.new_transfer.emit(self.model.connection, tx)
except Exception as e:
self._logger.error(str(e))
try:
new_dividends = await self.model.transactions_service.update_dividends_history( new_dividends = await self.model.transactions_service.update_dividends_history(
pubkey, pubkey,
self.view.table_history.model().ts_from, self.view.table_history.model().ts_from,
...@@ -214,3 +220,9 @@ class TxHistoryController(QObject): ...@@ -214,3 +220,9 @@ class TxHistoryController(QObject):
for ud in new_dividends: for ud in new_dividends:
self.model.app.new_dividend.emit(self.model.connection, ud) self.model.app.new_dividend.emit(self.model.connection, ud)
except Exception as e:
self._logger.error(str(e))
# enable update button
self.view.button_refresh.setDisabled(False)
self._logger.debug("Manually update tx history finished")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment