fixed converting to a vault with non-existent directory
This commit is contained in:
parent
0472cb23f6
commit
9ac185933b
2 changed files with 8 additions and 1 deletions
|
@ -44,8 +44,14 @@ object StorageUtils {
|
|||
|
||||
const val TRASH_PATH_PLACEHOLDER = "#trash"
|
||||
|
||||
// whether the provided path is on one of this app specific directories:
|
||||
// - /storage/{volume}/Android/data/{package_name}/files
|
||||
// - /data/user/0/{package_name}/files
|
||||
private fun isAppFile(context: Context, path: String): Boolean {
|
||||
val dirs = context.getExternalFilesDirs(null).filterNotNull()
|
||||
val dirs = listOf(
|
||||
*context.getExternalFilesDirs(null).filterNotNull().toTypedArray(),
|
||||
context.filesDir,
|
||||
)
|
||||
return dirs.any { path.startsWith(it.path) }
|
||||
}
|
||||
|
||||
|
|
|
@ -222,6 +222,7 @@ class _CollectionPageState extends State<CollectionPage> {
|
|||
final delayDuration = context.read<DurationsData>().staggeredAnimationPageTarget;
|
||||
await Future.delayed(delayDuration + Durations.highlightScrollInitDelay);
|
||||
|
||||
if (!mounted) return;
|
||||
final animate = context.read<Settings>().accessibilityAnimations.animate;
|
||||
context.read<HighlightInfo>().trackItem(item, animate: animate, highlightItem: item);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue