unsetActiveInstance method
Called when the instance given by instanceId is no longer the active instance.
- Unsets the globally active instance
- If
instanceIdis the active instance for its pane, it is unset as the active instance for that pane - Notifies listeners
Implementation
void unsetActiveInstance({
required String instanceId,
}) {
String? paneId;
api.workspace.workspaceConfigs.activeInstance = null;
for (final pane in api.workspace.workspaceConfigs.panesData.entries) {
if (pane.value.instances.contains(instanceId)) {
paneId = pane.key;
if (pane.value.activeInstance == instanceId) {
api.workspace.workspaceConfigs.panesData[pane.key]!.activeInstance =
null;
}
break;
}
}
AffogatoEvents.windowInstanceDidUnsetActiveEventsController.add(
WindowInstanceDidUnsetActiveEvent(
instanceId: instanceId,
),
);
if (paneId != null) {
AffogatoEvents.windowPaneRequestReloadEventsController
.add(WindowPaneRequestReloadEvent(paneId));
}
}