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

* always try on dialog show

* except logging

* huge oof
pull/36392/merge
Shane Smiskol 2 days ago committed by GitHub
parent 1f5e0b6f68
commit b28425b8c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      selfdrive/ui/widgets/pairing_dialog.py

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

Loading…
Cancel
Save