Skip to content

Commit

Permalink
Disallow File pinning: #76
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancoltech committed Mar 4, 2024
1 parent 0de33c7 commit 9aa4693
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.arkbuilders.components.filepicker

import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.viewModelScope
Expand Down Expand Up @@ -180,6 +181,9 @@ internal class ArkFilePickerViewModel(
}

fun pinFile(file: Path) = intent {
Log.d("tuancoltech", "pinFile isDirectory: " + file.isDirectory())
if (!file.isDirectory()) return@intent

val rootsWithFavorites = container.stateFlow.value.rootsWithFavs
val roots = rootsWithFavorites.keys
val root = roots.find { root -> file.startsWith(root) }
Expand Down

0 comments on commit 9aa4693

Please sign in to comment.