mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Fix progress being wrong in some cases
This commit is contained in:
parent
d60fff969b
commit
bda50dba72
2 changed files with 3 additions and 3 deletions
|
@ -152,14 +152,13 @@ public class BrowserTransferModel {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.fileEntry = fileEntry;
|
this.fileEntry = fileEntry;
|
||||||
this.localFile = localFile;
|
this.localFile = localFile;
|
||||||
this.progress =
|
this.progress = new SimpleObjectProperty<>();
|
||||||
new SimpleObjectProperty<>(BrowserTransferProgress.empty(fileEntry.getName(), fileEntry.getSize()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObservableBooleanValue downloadFinished() {
|
public ObservableBooleanValue downloadFinished() {
|
||||||
return Bindings.createBooleanBinding(
|
return Bindings.createBooleanBinding(
|
||||||
() -> {
|
() -> {
|
||||||
return progress.getValue().done();
|
return progress.getValue() != null && progress.getValue().done();
|
||||||
},
|
},
|
||||||
progress);
|
progress);
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,6 +335,7 @@ public class FileSystemHelper {
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progress.accept(BrowserTransferProgress.finished(sourceFile.getName(), transferred.get()));
|
||||||
Exception exception = null;
|
Exception exception = null;
|
||||||
try {
|
try {
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
|
|
Loading…
Reference in a new issue