Skip to content

Commit 8396f8d

Browse files
refactor(AnalyticalTable - useToggleRowExpand): remove useless conditional (#8552)
To fix this without changing functionality, simplify the boolean condition in `getToggleRowExpandedProps` at line 24 by removing the redundant `renderRowSubComponent && ...` branch. General approach: - Replace logically redundant boolean expressions with their minimal equivalent form. - Keep behavior identical while making intent explicit and avoiding static-analysis warnings. Best concrete fix in this file: - In `packages/main/src/components/AnalyticalTable/hooks/useToggleRowExpand.ts`, change: - `(!renderRowSubComponent || (renderRowSubComponent && alwaysShowSubComponent))` - to - `(!renderRowSubComponent || alwaysShowSubComponent)` No imports, helper methods, or additional definitions are required. _Suggested fixes powered by Copilot Autofix. Review carefully before merging._ Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent a878d16 commit 8396f8d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/main/src/components/AnalyticalTable/hooks/useToggleRowExpand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const getToggleRowExpandedProps = (
2121
}
2222

2323
let column = null;
24-
if (!isTreeTable && (!renderRowSubComponent || (renderRowSubComponent && alwaysShowSubComponent))) {
24+
if (!isTreeTable && (!renderRowSubComponent || alwaysShowSubComponent)) {
2525
if (!manualGroupBy) {
2626
column = row.cells.find((cell) => cell.column.id === row.groupByID)?.column;
2727
} else {

0 commit comments

Comments
 (0)