Add handling for "camera actions" 3rd checkbox state

This commit is contained in:
Ingvar Stepanyan
2021-07-26 15:00:35 +00:00
parent 36ed35192c
commit 8f30a60c2e
2 changed files with 24 additions and 6 deletions

View File

@@ -27,12 +27,17 @@ export class Widget extends Component {
if (this.state.inProgress && nextState.inProgress) {
return false;
}
if (this.state.inProgress || nextState.inProgress) {
return true;
}
let prevConfig = this.props.config;
let { config } = nextProps;
if (config.type === 'toggle' && config.value === undefined) {
return false;
}
return (
this.state.inProgress ||
nextState.inProgress ||
getValueForComparison(this.props.config) !==
getValueForComparison(nextProps.config) ||
this.props.config.readonly !== nextProps.config.readonly
getValueForComparison(config) !== getValueForComparison(prevConfig) ||
config.readonly !== prevConfig.readonly
);
}