only remove from index if no more files have the same comment

This commit is contained in:
Zlatin Balevsky
2019-10-16 14:21:50 +01:00
parent d0299f80c6
commit 942de287c6

View File

@ -119,11 +119,12 @@ class FileManager {
void onUICommentEvent(UICommentEvent e) {
if (e.oldComment != null) {
def comment = DataUtil.readi18nString(Base64.decode(e.oldComment))
index.remove(comment)
Set<File> existingFiles = commentToFile.get(comment)
existingFiles.remove(e.sharedFile.getFile())
if (existingFiles.isEmpty())
if (existingFiles.isEmpty()) {
commentToFile.remove(comment)
index.remove(comment)
}
}
String comment = e.sharedFile.getComment()