raylib: fix broken pairing dialog first 5m after startup (#36397)

* always try on dialog show

* except logging

* huge oof
This commit is contained in:
Shane Smiskol
2025-10-17 19:11:12 -07:00
committed by GitHub
parent 1f5e0b6f68
commit b28425b8c3
+5 -5
View File
@@ -34,7 +34,7 @@ class PairingDialog(Widget):
super().__init__()
self.params = Params()
self.qr_texture: rl.Texture | None = None
self.last_qr_generation = 0
self.last_qr_generation = float('-inf')
self._close_btn = IconButton(gui_app.texture("icons/close.png", 80, 80))
self._close_btn.set_click_callback(lambda: gui_app.set_modal_overlay(None))
@@ -42,8 +42,8 @@ class PairingDialog(Widget):
try:
dongle_id = self.params.get("DongleId") or ""
token = Api(dongle_id).get_token({'pair': True})
except Exception as e:
cloudlog.warning(f"Failed to get pairing token: {e}")
except Exception:
cloudlog.exception("Failed to get pairing token")
token = ""
return f"https://connect.comma.ai/?pair={token}"
@@ -67,8 +67,8 @@ class PairingDialog(Widget):
rl_image.format = rl.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
self.qr_texture = rl.load_texture_from_image(rl_image)
except Exception as e:
cloudlog.warning(f"QR code generation failed: {e}")
except Exception:
cloudlog.exception("QR code generation failed")
self.qr_texture = None
def _check_qr_refresh(self) -> None: