From b254bbb0ee52c87deff3bb6c84da939832d5f31a Mon Sep 17 00:00:00 2001 From: jane <33253363+jane-rose@users.noreply.github.com> Date: Fri, 13 Nov 2020 19:07:25 +0800 Subject: [PATCH] Fix: Fix a loading caselibrary bug (#556) --- src/app/widgets/CaseLibrary/index.jsx | 8 ++++---- src/app/widgets/PrintingConfigurations/Configurations.jsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/widgets/CaseLibrary/index.jsx b/src/app/widgets/CaseLibrary/index.jsx index 383fbb07a0..5161b3af5b 100644 --- a/src/app/widgets/CaseLibrary/index.jsx +++ b/src/app/widgets/CaseLibrary/index.jsx @@ -22,7 +22,7 @@ class CaseLibrary extends PureComponent { // laser: PropTypes.object.isRequired, insertDefaultCncTextVector: PropTypes.func.isRequired, insertDefaultLaserTextVector: PropTypes.func.isRequired, - updateDefaultAdvised: PropTypes.func.isRequired, + updateIsRecommended: PropTypes.func.isRequired, updateDefaultMaterialId: PropTypes.func.isRequired, updateDefaultQualityId: PropTypes.func.isRequired, qualityDefinitions: PropTypes.array.isRequired, @@ -69,9 +69,9 @@ class CaseLibrary extends PureComponent { const qualityDefinition = await this.props.qualityDefinitions.find(d => d.definitionId === qualityDefinitionId); if (qualityDefinition) { if (['quality.fast_print', 'quality.normal_quality', 'quality.high_quality'].indexOf(qualityDefinitionId) === -1) { - this.props.updateDefaultAdvised(false); + this.props.updateIsRecommended(false); } else { - this.props.updateDefaultAdvised(true); + this.props.updateIsRecommended(true); } this.props.updateDefaultQualityId(qualityDefinitionId); this.props.updateActiveDefinition(qualityDefinition); @@ -88,7 +88,7 @@ class CaseLibrary extends PureComponent { newDefinition.settings[key].from = addDefinition.definitionId; } } - this.props.updateDefaultAdvised(false); + this.props.updateIsRecommended(false); this.props.updateDefinitionSettings(newDefinition, newDefinition.settings); this.props.updateDefaultQualityId(newDefinition.definitionId); diff --git a/src/app/widgets/PrintingConfigurations/Configurations.jsx b/src/app/widgets/PrintingConfigurations/Configurations.jsx index f62fd96214..f0357ef388 100644 --- a/src/app/widgets/PrintingConfigurations/Configurations.jsx +++ b/src/app/widgets/PrintingConfigurations/Configurations.jsx @@ -287,7 +287,7 @@ class Configurations extends PureComponent { } }, onSetOfficialTab: (isRecommended) => { - if (isRecommended && /^quality.([0-9_]+)$/.test(this.props.defaultQualityId)) { + if (isRecommended && (/^quality.([0-9_]+)$/.test(this.props.defaultQualityId) || this.props.defaultQualityId.indexOf('Caselibrary') > -1)) { this.props.updateDefaultQualityId('quality.fast_print'); } this.props.updateIsRecommended(isRecommended);