fix: preserve camera controls when rebuilding the Radio panel

This commit is contained in:
Sameh Khamis committed 2026-09-13 01:23:55 -07:00
1 parent e1c3045203
commit 1b9ea0e8e3
2 files changed
+16 -1

No files matched your search

+16
View File
@@ -378,6 +378,22 @@ try {
return rect.width > 0 && rect.left >= 0 && rect.right <= innerWidth + 1;
}),
);
check(
'rebuilding Radio preserves the active camera controller and subscription',
await page.evaluate(() => {
const ui = window.__godsEyeView.styleManager;
const camera = ui._cctvControls;
const cameraId = camera.getState()?.activeCameraId;
ui._initRadioPanel();
ui._radioControls.connect();
return (
ui._cctvControls === camera &&
!camera.destroyed &&
Boolean(camera._cctvUnsubscribe) &&
camera.getState()?.activeCameraId === cameraId
);
}),
);
await page.evaluate(() => window.__godsEyeView.styleManager.dispose());
check(
'CCTV controller is destroyed with the real UI',
-1
View File
@@ -4885,7 +4885,6 @@ export class StyleManager {
/** Wire the independent Radio companion controls. */
_initRadioPanel() {
this._cctvControls?.destroy();
this._radioControls?.destroy();
this._radioControls = new RadioControls({
elements: {