fixed converting to a vault with non-existent directory

This commit is contained in:
Thibault Deckers 2023-03-11 18:20:17 +01:00
parent 0472cb23f6
commit 9ac185933b
2 changed files with 8 additions and 1 deletions

View file

@ -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) }
}

View file

@ -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);
}