Skip to content

Commit 8194bfe

Browse files
committed
bugfix[#63]: scrolling performance in param browser
1 parent 66a03b7 commit 8194bfe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/kotlin/com/androidvip/sysctlgui/ui/params/browse/BrowseParamsViewModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ class BrowseParamsViewModel(
104104

105105
private suspend fun getCurrentPathFiles(path: String) = withContext(dispatcher) {
106106
runCatching {
107-
SuFile.open(path).listFiles()?.toList()
107+
val baseFile = File(path)
108+
val file = if (baseFile.canRead()) baseFile else SuFile.open(path)
109+
file.listFiles()?.toList()
108110
}.getOrDefault(emptyList())
109111
}
110112

0 commit comments

Comments
 (0)