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

pull/24/head
Zlatin Balevsky 2019-10-16 14:21:50 +01:00
parent d0299f80c6
commit 942de287c6
1 changed files with 3 additions and 2 deletions

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()