aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx')
-rw-r--r--server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx27
1 files changed, 13 insertions, 14 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx
index 7ab4dcafc11..5aa28ff3d43 100644
--- a/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx
+++ b/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateApp.tsx
@@ -76,22 +76,21 @@ export default class ProjectQualityGateApp extends React.PureComponent<Props, St
if (!qualityGate.isDefault) {
return false;
- } else {
- // If this is the default Quality Gate, check if it was explicitly
- // selected, or if we're inheriting the system default.
- /* eslint-disable-next-line sonarjs/prefer-immediate-return */
- const selected = await searchProjects({
- gateName: qualityGate.name,
- query: component.key
+ }
+
+ // If this is the default Quality Gate, check if it was explicitly
+ // selected, or if we're inheriting the system default.
+ const selected = await searchProjects({
+ gateName: qualityGate.name,
+ query: component.key
+ })
+ .then(({ results }) => {
+ return Boolean(results.find(r => r.key === component.key)?.selected);
})
- .then(({ results }) => {
- return Boolean(results.find(r => r.key === component.key)?.selected);
- })
- .catch(() => false);
+ .catch(() => false);
- // If it's NOT selected, it means we're following the system default.
- return !selected;
- }
+ // If it's NOT selected, it means we're following the system default.
+ return !selected;
};
fetchQualityGates = async () => {