Fix no dirs can be picked if root dir is not set

This commit is contained in:
Ming Ming 2021-07-03 22:31:42 +08:00
parent f7e7a339f6
commit 89eaff4ea8

View file

@ -64,6 +64,9 @@ class _AlbumDirPickerState extends State<AlbumDirPicker>
@override
canPickDir(File dir) {
if (widget.account.roots.contains("")) {
return true;
}
final root = api_util.getWebdavRootUrlRelative(widget.account);
return widget.account.roots
.any((r) => dir.path == "$root/$r" || dir.path.startsWith("$root/$r/"));