mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-08-19 21:56:07 +00:00
fixing bug where the mountName of the vault is initially set as the default one
This commit is contained in:
@@ -63,12 +63,18 @@ public class VaultSettings {
|
||||
return new Observable[]{path, mountName, winDriveLetter, unlockAfterStartup, revealAfterMount, useCustomMountPath, customMountPath, usesReadOnlyMode, mountFlags, filenameLengthLimit, actionAfterUnlock};
|
||||
}
|
||||
|
||||
private void deriveMountNameFromPathOrUseDefault(Path path) {
|
||||
if (StringUtils.isBlank(mountName.get())) {
|
||||
if (path != null && path.getFileName() != null) {
|
||||
mountName.set(normalizeMountName(path.getFileName().toString()));
|
||||
} else {
|
||||
mountName.set(DEFAULT_MOUNT_NAME);
|
||||
private void deriveMountNameFromPathOrUseDefault(Path newPath) {
|
||||
final boolean mountNameSet = !StringUtils.isBlank(mountName.get());
|
||||
final boolean dirnameExists = (newPath != null) && (newPath.getFileName() != null);
|
||||
|
||||
if (!mountNameSet && dirnameExists) {
|
||||
mountName.set(normalizeMountName(newPath.getFileName().toString()));
|
||||
} else if (!mountNameSet && !dirnameExists) {
|
||||
mountName.set(DEFAULT_MOUNT_NAME+id);
|
||||
}else if (mountNameSet && dirnameExists) {
|
||||
if(mountName.get().equals(DEFAULT_MOUNT_NAME+id)){
|
||||
//this is okay, since this function is only executed if the path changes (aka, the vault is created or added)
|
||||
mountName.set(newPath.getFileName().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user