refactored code and new method handleDokanySupportEndAndShowDialog

This commit is contained in:
Jan-Peter Klein 2024-06-13 12:06:18 +02:00
parent 9fcb166047
commit 0bbc4ecae5
No known key found for this signature in database
GPG Key ID: 90EDA3A7C822FD0E

View File

@ -76,24 +76,27 @@ public class FxApplication {
appWindows.checkAndShowUpdateReminderWindow();
}
var dokany = "org.cryptomator.frontend.dokany.mount.DokanyMountProvider";
boolean dokanySupportEndWindowShown = false;
if (settings.mountService.getValueSafe().equals(dokany)) {
appWindows.showDokanySupportEndWindow();
dokanySupportEndWindowShown = true;
settings.mountService.set(null);
}
for (VaultSettings vaultSettings : settings.directories) {
if (vaultSettings.mountService.getValueSafe().equals(dokany)) {
if (!dokanySupportEndWindowShown) {
appWindows.showDokanySupportEndWindow();
dokanySupportEndWindowShown = true;
}
vaultSettings.mountService.set(null);
}
}
handleDokanySupportEndAndShowDialog();
launchEventHandler.startHandlingLaunchEvents();
autoUnlocker.tryUnlockForTimespan(2, TimeUnit.MINUTES);
}
private void handleDokanySupportEndAndShowDialog() {
var dokanyProviderId = "org.cryptomator.frontend.dokany.mount.DokanyMountProvider";
boolean dokanyFound = false;
if (settings.mountService.getValueSafe().contains(dokanyProviderId)) {
dokanyFound = true;
settings.mountService.set(null);
}
for (VaultSettings vaultSettings : settings.directories) {
if (vaultSettings.mountService.getValueSafe().contains(dokanyProviderId)) {
dokanyFound = true;
vaultSettings.mountService.set(null);
}
}
if(dokanyFound) {
appWindows.showDokanySupportEndWindow();
}
}
}