make sure New Folder appears first on the list
This commit is contained in:
parent
8ff9e7f6ad
commit
04ab018a32
1 changed files with 9 additions and 1 deletions
|
@ -78,12 +78,20 @@ fun Context.movePinnedDirectoriesToFront(dirs: ArrayList<Directory>): ArrayList<
|
||||||
val pinnedFolders = config.pinnedFolders
|
val pinnedFolders = config.pinnedFolders
|
||||||
|
|
||||||
dirs.forEach {
|
dirs.forEach {
|
||||||
if (pinnedFolders.contains(it.path))
|
if (pinnedFolders.contains(it.path)) {
|
||||||
foundFolders.add(it)
|
foundFolders.add(it)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dirs.removeAll(foundFolders)
|
dirs.removeAll(foundFolders)
|
||||||
dirs.addAll(0, foundFolders)
|
dirs.addAll(0, foundFolders)
|
||||||
|
if (config.tempFolderPath.isNotEmpty()) {
|
||||||
|
val newFolder = dirs.firstOrNull { it.path == config.tempFolderPath }
|
||||||
|
if (newFolder != null) {
|
||||||
|
dirs.remove(newFolder)
|
||||||
|
dirs.add(0, newFolder)
|
||||||
|
}
|
||||||
|
}
|
||||||
return dirs
|
return dirs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue