Fix icons race condition

This commit is contained in:
crschnick
2025-02-11 16:56:50 +00:00
parent dae161f0ec
commit 770cf6d1f3
2 changed files with 8 additions and 1 deletions
@@ -79,6 +79,7 @@ public class BaseMode extends OperationMode {
}
var imagesLoaded = new CountDownLatch(1);
var iconsLoaded = new CountDownLatch(1);
var browserLoaded = new CountDownLatch(1);
var shellLoaded = new CountDownLatch(1);
var storageLoaded = new CountDownLatch(1);
@@ -113,6 +114,7 @@ public class BaseMode extends OperationMode {
});
imagesLoaded.await();
browserLoaded.await();
iconsLoaded.await();
AppDialog.waitForAllDialogsClose();
PlatformThread.runLaterIfNeededBlocking(() -> {
try {
@@ -136,6 +138,7 @@ public class BaseMode extends OperationMode {
imagesLoaded.countDown();
storageLoaded.await();
SystemIconManager.init();
iconsLoaded.countDown();
},
() -> {
BrowserIconManager.loadIfNecessary();
@@ -103,7 +103,11 @@ public class AppImages {
}
var key = file.contains(":") ? file : "app:" + file;
return images.containsKey(key);
if (images.containsKey(key)) {
return true;
}
return false;
}
public static Image image(String file) {