mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-06-21 22:09:09 -04:00
[release]
This commit is contained in:
@@ -52,7 +52,7 @@ public class LocalFileTransferStage {
|
||||
items.add(item);
|
||||
executor.submit(() -> {
|
||||
try {
|
||||
FileUtils.forceMkdirParent(TEMP.toFile());
|
||||
FileUtils.forceMkdir(TEMP.toFile());
|
||||
try (var b = new BusyProperty(downloading)) {
|
||||
FileSystemHelper.dropFilesInto(FileSystemHelper.getLocal(TEMP), List.of(entry), false);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,11 @@ public class UpdateCheckComp extends SimpleComp {
|
||||
}
|
||||
|
||||
private void restart() {
|
||||
// Check if we're still on latest
|
||||
if (!AppUpdater.get().isDownloadedUpdateStillLatest()) {
|
||||
return;
|
||||
}
|
||||
|
||||
AppUpdater.get().executeUpdateAndClose();
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class TerminalErrorHandler implements ErrorHandler {
|
||||
try {
|
||||
AppUpdater.init();
|
||||
var rel = AppUpdater.get().checkForUpdate(true);
|
||||
if (rel.isUpdate()) {
|
||||
if (rel != null && rel.isUpdate()) {
|
||||
var update = AppWindowHelper.showBlockingAlert(alert -> {
|
||||
alert.setAlertType(Alert.AlertType.INFORMATION);
|
||||
alert.setTitle(AppI18n.get("updateAvailableTitle"));
|
||||
|
||||
@@ -101,8 +101,9 @@ public class AppUpdater {
|
||||
ThreadHelper.sleep(Duration.ofMinutes(10).toMillis());
|
||||
event("Starting background updater thread");
|
||||
while (true) {
|
||||
if (INSTANCE.checkForUpdate(false) != null
|
||||
&& AppPrefs.get().automaticallyUpdate().get()) {
|
||||
var rel = INSTANCE.checkForUpdate(false);
|
||||
if (rel != null
|
||||
&& AppPrefs.get().automaticallyUpdate().get() && rel.isUpdate()) {
|
||||
event("Performing background update");
|
||||
INSTANCE.downloadUpdate();
|
||||
}
|
||||
@@ -226,7 +227,15 @@ public class AppUpdater {
|
||||
}
|
||||
|
||||
public synchronized boolean isDownloadedUpdateStillLatest() {
|
||||
if (downloadedUpdate.getValue() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var available = checkForUpdate(true);
|
||||
if (available == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return downloadedUpdate.getValue() != null
|
||||
&& available.getVersion().equals(downloadedUpdate.getValue().getVersion());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user