mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix(scan_control): safeguard against empty history; reversed history to fetch the newest scan
This commit is contained in:
@ -208,11 +208,14 @@ class ScanControl(BECWidget, QWidget):
|
|||||||
return
|
return
|
||||||
|
|
||||||
current_scan = self.comboBox_scan_selection.currentText()
|
current_scan = self.comboBox_scan_selection.currentText()
|
||||||
history = self.client.connector.xread(
|
history = (
|
||||||
MessageEndpoints.scan_history(), from_start=True, user_id=self.object_name
|
self.client.connector.xread(
|
||||||
|
MessageEndpoints.scan_history(), from_start=True, user_id=self.object_name
|
||||||
|
)
|
||||||
|
or []
|
||||||
)
|
)
|
||||||
|
|
||||||
for scan in history:
|
for scan in reversed(history):
|
||||||
scan_data = scan.get("data")
|
scan_data = scan.get("data")
|
||||||
if not scan_data:
|
if not scan_data:
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user