-
Notifications
You must be signed in to change notification settings - Fork 119
Periodically check wallet plugin status #86
Conversation
// 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'); |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
2aadeef
to
a0f7e33
Compare
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Re-based after recent merges. |
Periodically check wallet plugin status
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.