fix: [AA-1219] Crash when locked content rendered without unit ID (#878)

Allows SequenceNavigation to complete rendering even if unitId is not provided.
This commit is contained in:
Chris Deery
2022-03-22 17:35:45 -04:00
committed by GitHub
parent 14a19b2794
commit f7219b4f5d

View File

@@ -69,8 +69,13 @@ UnitButton.defaultProps = {
showCompletion: true,
};
const mapStateToProps = (state, props) => ({
...state.models.units[props.unitId],
});
const mapStateToProps = (state, props) => {
if (props.unitId) {
return {
...state.models.units[props.unitId],
};
}
return {};
};
export default connect(mapStateToProps)(UnitButton);