mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
fix: preserve camera controls when rebuilding the Radio panel
This commit is contained in:
1 parent
e1c3045203
commit
1b9ea0e8e3
2 files changed
+16
-1
No files matched your search
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user