0
0
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:
2025-06-25 16:07:17 +02:00
committed by Jan Wyzula
parent cba4d47f76
commit 29a26b19f9

View File

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