Fix progress being wrong in some cases

This commit is contained in:
crschnick 2024-03-02 13:23:40 +00:00
parent d60fff969b
commit bda50dba72
2 changed files with 3 additions and 3 deletions

View file

@ -152,14 +152,13 @@ public class BrowserTransferModel {
this.name = name;
this.fileEntry = fileEntry;
this.localFile = localFile;
this.progress =
new SimpleObjectProperty<>(BrowserTransferProgress.empty(fileEntry.getName(), fileEntry.getSize()));
this.progress = new SimpleObjectProperty<>();
}
public ObservableBooleanValue downloadFinished() {
return Bindings.createBooleanBinding(
() -> {
return progress.getValue().done();
return progress.getValue() != null && progress.getValue().done();
},
progress);
}

View file

@ -335,6 +335,7 @@ public class FileSystemHelper {
throw ex;
}
progress.accept(BrowserTransferProgress.finished(sourceFile.getName(), transferred.get()));
Exception exception = null;
try {
inputStream.close();