Fixed crash when clicking on a ref with a ref that's not shown in the log
This commit is contained in:
parent
e12a5ee2e2
commit
45d89f3699
@ -91,8 +91,14 @@ fun Log(
|
|||||||
|
|
||||||
LaunchedEffect(selectedCommit) {
|
LaunchedEffect(selectedCommit) {
|
||||||
// Scroll to commit if a Ref is selected
|
// Scroll to commit if a Ref is selected
|
||||||
if (selectedItem is SelectedItem.Ref)
|
if (selectedItem is SelectedItem.Ref) {
|
||||||
scrollState.scrollToItem(commitList.indexOfFirst { it.name == selectedCommit?.name })
|
val index = commitList.indexOfFirst { it.name == selectedCommit?.name }
|
||||||
|
// TODO Show a message informing the user why we aren't scrolling
|
||||||
|
// Index can be -1 if the ref points to a commit that is not shown in the graph due to the limited
|
||||||
|
// number of displayed commits.
|
||||||
|
if (index >= 0)
|
||||||
|
scrollState.scrollToItem(index)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LogDialogs(
|
LogDialogs(
|
||||||
|
Loading…
Reference in New Issue
Block a user