Flip negated conditions to positive for readability (S7735)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1670,7 +1670,7 @@ function checkCycleTime() {
|
||||
return disabled;
|
||||
}
|
||||
function checkStartAndEnd(start, end) {
|
||||
return !isAlreadySubmit.value ? !(start && end) : start !== end;
|
||||
return isAlreadySubmit.value ? start !== end : !(start && end);
|
||||
}
|
||||
|
||||
// created() logic
|
||||
|
||||
@@ -173,7 +173,7 @@ const data = computed(() => {
|
||||
// Sort the Activity List
|
||||
return [...filteredData.value].sort((x, y) => {
|
||||
const diff = y.occurrences - x.occurrences;
|
||||
return diff !== 0 ? diff : sortNumEngZhtwForFilter(x.label, y.label);
|
||||
return diff === 0 ? sortNumEngZhtwForFilter(x.label, y.label) : diff;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ function isRule(e, index) {
|
||||
const rule = isRuleData.value[index];
|
||||
// First get the rule object
|
||||
// To preserve data order, set the value to 0 and remove it during submitAll
|
||||
if (!e) temporaryData.value[index] = 0;
|
||||
else temporaryData.value[index] = rule;
|
||||
if (e) temporaryData.value[index] = rule;
|
||||
else temporaryData.value[index] = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1008,14 +1008,14 @@ function getTraceData(isExclude) {
|
||||
* @param {Array} postData - The submitted filter data.
|
||||
*/
|
||||
function updateRules(postData) {
|
||||
if (!temporaryData.value?.length) {
|
||||
temporaryData.value.push(...postData);
|
||||
isRuleData.value = Array.from(temporaryData.value);
|
||||
ruleData.value = isRuleData.value.map((e) => setRule(e));
|
||||
} else {
|
||||
if (temporaryData.value?.length) {
|
||||
temporaryData.value.push(...postData);
|
||||
isRuleData.value.push(...postData);
|
||||
ruleData.value.push(...postData.map((e) => setRule(e)));
|
||||
} else {
|
||||
temporaryData.value.push(...postData);
|
||||
isRuleData.value = Array.from(temporaryData.value);
|
||||
ruleData.value = isRuleData.value.map((e) => setRule(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user