( state: AutomationStateMetadata | null | undefined, )
| 231 | } |
| 232 | |
| 233 | export function notifyAutomationStateChanged( |
| 234 | state: AutomationStateMetadata | null | undefined, |
| 235 | ): void { |
| 236 | const nextState = normalizeAutomationState(state) |
| 237 | if ( |
| 238 | automationStateKey(nextState) === automationStateKey(currentAutomationState) |
| 239 | ) { |
| 240 | return |
| 241 | } |
| 242 | |
| 243 | currentAutomationState = nextState |
| 244 | applyMetadataUpdate({ automation_state: nextState }) |
| 245 | metadataListener?.({ automation_state: nextState }) |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Fired by onChangeAppState when toolPermissionContext.mode changes. |
no test coverage detected