Collapse the CCTV panel when the user switches CCTV off inside Contacts

Turning a layer on does not leave Contacts, so a user could turn CCTV back
on inside the mode and off again; the layer was still in the session
snapshot and the panel stayed open on an empty frame. The snapshot now
records every layer the user switched during the session, and
suspendsLayer is true only for a layer isolation switched off that the
user has not touched since.
This commit is contained in:
Sameh Khamis committed 2026-11-13 18:12:44 -08:00
1 parent f29b0b2639
commit f0ee1b95ca
4 files changed
+47 -2

No files matched your search

+7 -2
View File
@@ -61,12 +61,17 @@ export class ContextControls {
}
/**
* Whether Context isolation switched this layer off and leaving the mode
* restores it. Such a layer is suspended, not switched off by the user.
* restores it. Such a layer is suspended, not switched off by the user: a
* layer the user switched during the session is theirs again.
* @param {string} layerId Layer id.
* @returns {boolean}
*/
suspendsLayer(layerId) {
return Boolean(this._contextSessionSnapshot?.enabledLayerIds?.has(layerId));
const snapshot = this._contextSessionSnapshot;
return Boolean(
snapshot?.enabledLayerIds?.has(layerId) &&
!snapshot.userSwitched?.has(layerId),
);
}
setClearBusy(...args) {
if (!this.destroyed) this.actions.setClearBusy(...args);