Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
strip out update code
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechampine committed Oct 20, 2015
1 parent bb972c2 commit 14fd0c3
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions app/js/daemonManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function DaemonManager() {
* @param {function} isNotRunning - function to run if Siad is not running
*/
function ifSiad(isRunning, isNotRunning) {
apiCall('/consensus', function(err) {
apiCall('/daemon/version', function(err) {
if (!err) {
self.Running = true;
isRunning();
Expand All @@ -71,19 +71,8 @@ function DaemonManager() {
// Update check will delay API calls until successful. Will wait the
// duration that it takes to load up the blockchain.
apiCall("/daemon/updates/check", function(err, update) {
if (err) {
self.Running = false;
// Check again later
setTimeout(updatePrompt, 1000);
} else if (update.Available) {
self.Running = true;
UI.notify("New Sia Client Available: Click to update to " + update.Version, "update", function() {
Shell.openExternal('https://www.github.com/NebulousLabs/Sia-UI/releases');
});
} else {
self.Running = true;
UI.notify("Sia client up to date!", "success");
}
// TODO: proper update checking; maybe use GitHub API?
UI.notify("Sia client up to date!", "success");
});
}

Expand Down

9 comments on commit 14fd0c3

@Mingling94
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ffs, this could have just had the api call changed. Or just remove the apiCall() if '/daemon/updates/check' isn't an endpoint anymore. This is now nonsensical and there's a useless button based on it in the top-right

@DavidVorick
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was pushed directly to master? =/

@DavidVorick
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does electron support in-place updating?

@Mingling94
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would a user need to update in place? I can't think of many applications that do that.

@DavidVorick
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess restarting is fine. I just don't want people to have to be copying folders and consensus data and whatnot

@Mingling94
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's necessarily going to require an installer executable, right? Isn't that how every other app works?

@DavidVorick
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'siad' is able to upgrade in-place, which means users never have to touch or copy the files.

@Mingling94
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because it's one file executable, I'm not sure of how we could get Sia UI to that level.

I suppose that with a separately located siad folder, the UI just needs to maintain the config.json that points to it. Then the UI could be installed over without manual copying of the siad files. However this requires a settings page

@lukechampine
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real issue here was that the existing code wasn't handling the error condition properly. Instead of setting Running to false and trying again later, it should have just silently done nothing.
And fwiw, the current update system is deprecated, so the update dialog wasn't serving much purpose anyway.

Please sign in to comment.