Skip to content

Commit

Permalink
Use findFileIndexByID
Browse files Browse the repository at this point in the history
  • Loading branch information
tidy-dev committed Dec 19, 2024
1 parent 178cf48 commit 7817143
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/src/ui/changes/filter-changes-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1041,9 +1041,10 @@ export class FilterChangesList extends React.Component<
item: IChangesListItem,
source: ClickSource
) => {
const fileIndex = this.props.workingDirectory.files.findIndex(
f => f.id === item.change.id
const fileIndex = this.props.workingDirectory.findFileIndexByID(
item.change.id
)

this.props.onRowClick?.(fileIndex, source)
}

Expand All @@ -1053,11 +1054,7 @@ export class FilterChangesList extends React.Component<

private onFileSelectionChanged = (item: IChangesListItem | null) => {
const rows = item
? [
this.props.workingDirectory.files.findIndex(
f => f.id === item.change.id
),
]
? [this.props.workingDirectory.findFileIndexByID(item.change.id)]
: []
this.props.onFileSelectionChanged(rows)
}
Expand Down

0 comments on commit 7817143

Please sign in to comment.