diff --git a/src/main/java/com/owncloud/android/ui/adapter/UnifiedSearchItemViewHolder.kt b/src/main/java/com/owncloud/android/ui/adapter/UnifiedSearchItemViewHolder.kt index c9f43a8cb2..134ef39aaa 100644 --- a/src/main/java/com/owncloud/android/ui/adapter/UnifiedSearchItemViewHolder.kt +++ b/src/main/java/com/owncloud/android/ui/adapter/UnifiedSearchItemViewHolder.kt @@ -59,12 +59,10 @@ class UnifiedSearchItemViewHolder( binding.title.text = entry.title binding.subline.text = entry.subline - storageManager.getFileByDecryptedRemotePath(entry.remotePath())?.let { - if (it.isDown) { - binding.localFileIndicator.visibility = View.VISIBLE - } else { - binding.localFileIndicator.visibility = View.GONE - } + if (entry.isFile && storageManager.getFileByDecryptedRemotePath(entry.remotePath()) != null) { + binding.localFileIndicator.visibility = View.VISIBLE + } else { + binding.localFileIndicator.visibility = View.GONE } val mimetype = MimeTypeUtil.getBestMimeTypeByFilename(entry.title) diff --git a/src/main/java/com/owncloud/android/ui/unifiedsearch/UnifiedSearchViewModel.kt b/src/main/java/com/owncloud/android/ui/unifiedsearch/UnifiedSearchViewModel.kt index 7fd0c1d713..9d42e1c410 100644 --- a/src/main/java/com/owncloud/android/ui/unifiedsearch/UnifiedSearchViewModel.kt +++ b/src/main/java/com/owncloud/android/ui/unifiedsearch/UnifiedSearchViewModel.kt @@ -144,7 +144,7 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic } override fun openResult(result: SearchResultEntry) { - if (result.fileId() != null) { + if (result.isFile) { openFile(result.remotePath()) } else { val uri = Uri.parse(result.resourceUrl)