Fix crash in library when selected category is deleted (#9044)

This commit is contained in:
0x7673 2023-02-08 08:49:46 +05:30 committed by GitHub
parent bd2cb97179
commit 13bb45b4be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,6 +60,9 @@ fun LibraryContent(
var isRefreshing by remember(pagerState.currentPage) { mutableStateOf(false) }
if (showPageTabs && categories.size > 1) {
if (categories.size <= pagerState.currentPage) {
pagerState.currentPage = categories.size - 1
}
LibraryTabs(
categories = categories,
currentPageIndex = pagerState.currentPage,