Conversation
// make sure to display some kind of "in-progress" state. | ||
return signerPromise | ||
.then((signer) => { | ||
return noncePromise |
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.
You may want to use Promise.all
here.
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.
👍
|
||
// Setup the Service Worker | ||
if ('serviceWorker' in navigator) { | ||
workerRegistration = runtime |
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.
You can return
here directly.
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.
Yep that's right (wasn't in a function previously...)
const state = getState(); | ||
const stateWorker = state.worker.worker; | ||
|
||
if (stateWorker !== undefined && !(stateWorker && stateWorker._worker.state === 'redundant')) { |
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.
state.worker.worker
might also be null
, judging from the reducer.
if (stateWorker && stateWorker._worker.state !== 'redundant')
?
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.
This is just because worker
can be undefined if it hasn't loaded yet, or null
if not supported
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.
So my proposal would work?
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.
Well it wouldn't take into account when stateWorker
is null
.
|
||
const { worker } = store.getState().worker; | ||
|
||
const signerPromise = worker && worker._worker.state === 'activated' |
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.
Why not store the worker object as state.worker
itself?
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.
Because it also have an error
field that gets displayed in Contract Dev. Could get rid of it though
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.
(We might want to add other fields, like stats, ...)
Closes #3233
Also display the password hint if found in the key.
To test :
~/.parity/keys/test/....
to somewhere else