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

Periodically check wallet plugin status #86

Merged
merged 1 commit into from
Oct 16, 2015

Conversation

bitspill
Copy link
Contributor

If you launch the UI and quickly tab over to Wallet before the daemon is launched and checked for updates the tab will be in a "stuck" state without updating it's status.

The initial update check is aborted if (!Daemon.Running) which isn't set until a few seconds after launch, so periodically try again until the daemon is online and responds.

// Need to check if wallet's unencrypted
IPC.sendToHost('api-call', '/wallet', 'on-opened');
// Need to check if wallet's unencrypted, keep checking until we get a response
updating = setInterval(IPC.sendToHost, 500, 'api-call', '/wallet', 'on-opened');
Copy link
Contributor

Choose a reason for hiding this comment

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

I would do this in a slightly different way. You're using the same variable, updating, that the update function uses and that's confusing its purpose. Make a new variable called starting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered that however to me both of these uses were "updating" so it seemed to fit.

I'll move it over to a seperate starting variable for more clarity.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, it makes more sense to just combine the 'on-opened' and 'update-status' listeners. They're the same call and data, so why not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, that does sound reasonable, done.

@bitspill bitspill force-pushed the TooSoon branch 4 times, most recently from 2aadeef to a0f7e33 Compare October 13, 2015 05:59
@bitspill
Copy link
Contributor Author

Updated after the wallet restyling merge.

refreshRate = finalRefreshRate; // slow down after first successful call

// Show correct lock status.
// TODO: If the wallet is encrypted, prompt with a pw.
Copy link
Member

Choose a reason for hiding this comment

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

password prompt should not appear until the user hits the 'encrypt' button. Standard instinct when dealing with app popups is to TL;DR and close them, then people don't know their password.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's an old ToDo, I adjusted the line formatting and moved it to a different location so git shows it as added.

https://github.com/NebulousLabs/Sia-UI/blob/master/app/plugins/Wallet/js/lifecycle.js#L183

Copy link
Contributor

Choose a reason for hiding this comment

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

What I meant when I wrote the TODO is that when opening the wallet plugin, the user should be prompted to enter their password. Unless it's viable that the plugin is used meaningfully when locked, the user should login on opening, right?

Copy link
Member

Choose a reason for hiding this comment

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

ok, I think this TODO can be removed at this point

Copy link
Member

Choose a reason for hiding this comment

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

@Mingling94 I think we commented at the same time.

After you unlock the wallet the first time, it's viable to see your balance and txn history while the wallet is locked. I'm planning some upgrades so that this is also true even if you haven't yet unlocked the wallet. Also, it will eventually be okay to mine + do some forms of hosting and renting while the wallet is locked. None of these features are yet available, but they are in the pipeline.

@bitspill
Copy link
Contributor Author

Re-based after recent merges.

DavidVorick added a commit that referenced this pull request Oct 16, 2015
Periodically check wallet plugin status
@DavidVorick DavidVorick merged commit 4b07cca into NebulousLabs:master Oct 16, 2015
@bitspill bitspill deleted the TooSoon branch October 20, 2015 08:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants