Do not apply a panel's first view twice

The panel starts the app from the first view's link, which the app
restores, following included. Sending the same view again once the app
was ready flew the camera to it, which ended the follow and left cockpit
view. The panel now sends only views that arrive while the app loads.
This commit is contained in:
Sameh Khamis committed 2026-10-02 18:29:42 -07:00
1 parent 9bc031c753
commit 89a448ee83
1 file changed
+5 -2
+5 -2
View File
@@ -461,7 +461,7 @@ export function panelRuntime(config) {
* Load God's Eye View into this page from the app's panel build, in
* inline embed mode, starting at the first view as its link would.
*/
async function startApp(url) {
async function startApp(url, view) {
window.GEV_EMBED_INLINE = true;
window.GEV_APP_BASE_URL = config.appBaseUrl;
try {
@@ -470,6 +470,9 @@ export function panelRuntime(config) {
'',
location.href.split('#')[0] + new URL(url).hash,
);
// The app restores this view from its link, following included, so
// it must not be applied again: flying there would end the follow.
if (queued === view) queued = null;
} catch {
// The view still arrives once the app is ready.
}
@@ -554,7 +557,7 @@ export function panelRuntime(config) {
if (started) return;
started = true;
say("Loading God's Eye View…");
startApp(url).catch((error) =>
startApp(url, view).catch((error) =>
say(`God's Eye View could not load here: ${error?.message || error}.`),
);
setTimeout(() => {