From f7dbac464969f6bff8ac1b4a16b57ecf5d95bd2e Mon Sep 17 00:00:00 2001 From: Maxime Catrice Date: Sat, 25 Apr 2020 11:48:19 +0200 Subject: Fix search if external root dir starts with a dot (#743) Fixes #740 Co-Authored-By: Fabian Henneke --- app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt b/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt index 3dcca85f..1f431a0e 100644 --- a/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt +++ b/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt @@ -266,7 +266,8 @@ class SearchableRepositoryViewModel(application: Application) : AndroidViewModel private fun listFilesRecursively(dir: File): Flow { return dir - .walkTopDown().onEnter { file -> shouldTake(file) } + // Take top directory even if it is hidden. + .walkTopDown().onEnter { file -> file == dir || shouldTake(file) } .asFlow() // Skip the root directory .drop(1) -- cgit v1.2.3