feat(k1): wire canonical control session to UI
This commit is contained in:
@@ -140,13 +140,17 @@ export function XgridsK1RuntimeProvider({
|
||||
if (!activeModel) return;
|
||||
return registerDeactivation(async () => {
|
||||
if (controller.pendingAction !== null) return false;
|
||||
// Always ask the backend to stop. The browser snapshot may be stale or not
|
||||
// loaded yet, while a previous local capture is still alive.
|
||||
// Never translate navigation/model switching into a K1 control command.
|
||||
// The operator must explicitly finish or close the canonical dialogue.
|
||||
if (controller.state?.application_control_session?.control_socket_open) {
|
||||
return false;
|
||||
}
|
||||
return controller.stop();
|
||||
});
|
||||
}, [
|
||||
activeModel,
|
||||
controller.pendingAction,
|
||||
controller.state?.application_control_session?.control_socket_open,
|
||||
controller.stop,
|
||||
registerDeactivation,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user