mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
@@ -73,7 +73,9 @@ public class NotificationManager {
|
||||
* @param target list where the filesystem events are copied to
|
||||
* @return {@code true}, if elements were copied
|
||||
*/
|
||||
public boolean addTo(List<VaultEvent> target) {
|
||||
public boolean appendToAndClear(List<VaultEvent> target) {
|
||||
//it is not clear, if addAll iterates thread-safe over the pendingEvents
|
||||
//hence we synchronize moving (copy then clear) and adding-single-element operations
|
||||
synchronized (this) {
|
||||
var result = target.addAll(pendingEvents);
|
||||
pendingEvents.clear();
|
||||
|
||||
@@ -43,7 +43,7 @@ public class FxNotificationManager {
|
||||
|
||||
private void checkForPendingNotifications() {
|
||||
Platform.runLater(() -> {
|
||||
if (notificationManager.addTo(eventsRequiringNotification)) {
|
||||
if (notificationManager.appendToAndClear(eventsRequiringNotification)) {
|
||||
applicationWindows.showNotification();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user