-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DDW-81] Improve redirecting logic of network store #723
[DDW-81] Improve redirecting logic of network store #723
Conversation
@nikolaglumac this is now also ready to be reviewed! |
@@ -32,7 +31,7 @@ export default class LoadingPage extends Component<InjectedProps> { | |||
allowedTimeDifference={ALLOWED_TIME_DIFFERENCE} | |||
isConnecting={isConnecting} | |||
syncPercentage={syncPercentage} | |||
isLoadingDataForNextScreen={isLoadingWallets} | |||
isLoadingDataForNextScreen={!isSyncing || isSynced} |
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.
@DominikGuzei I believe we should take this opportunity to refactor isSyncing
and isSynced
logic in the NetworkStatusStore
: https://github.com/input-output-hk/daedalus/blob/development-webpack-fork/source/renderer/app/stores/NetworkStatusStore.js#L140-L151
} | ||
|
||
setup() { | ||
async setup() { |
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.
@DominikGuzei can you explain what is the reason for async
here?
this._updateSyncProgress, SYNC_PROGRESS_INTERVAL | ||
); | ||
if (environment.isAdaApi()) { | ||
this._updateLocalTimeDifferencePollInterval = setInterval( |
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.
@DominikGuzei I fear this update is in collision with the following improvement: #719
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.
No it isn't the code is even better now, you have to read through it carefully 😉
Logger.debug('Stopped polling local time difference'); | ||
if (this._timeDifferencePollInterval) clearInterval(this._timeDifferencePollInterval); | ||
_updateLocalTimeDifferenceWhenConnected = async () => { | ||
if (this.isConnected) await this._updateLocalTimeDifference(); |
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.
@DominikGuzei this call should be made only in case of environment.isAdaApi()
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.
@DominikGuzei we should discuss how to proceed with this PR on Monday. This part of the application is very sensitive (as you already know) and I think we should re-define how to handle all the cases.
…-handling-in-network-store
@DominikGuzei can you please merge in latest develop in your branch? I will review this PR after you do that. Thanks! |
@DominikGuzei please merge in latest develop so that this one can finally be reviewed :) Thanks! |
@nikolaglumac i fixed the conflicts with latest |
Let's wait with merging this PR until the 1.3 release cut off date. |
@nikolaglumac this is ready for review (again) |
@DominikGuzei reviewing it now! (again) |
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.
Great work @DominikGuzei!
The only issue is that if you have no wallets and you try top open Ada redemption screen from the application menu you end up on the Add wallet screen :(
@@ -62,6 +62,7 @@ export default class AdaRedemptionStore extends Store { | |||
ipcRenderer.on(PARSE_REDEMPTION_CODE.ERROR, this._onParseError); | |||
this.registerReactions([ | |||
this._resetRedemptionFormValuesOnAdaRedemptionPageLoad, | |||
this._redirectToAddWalletBeforeRedemption, |
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.
@DominikGuzei I don't think we need this redirect anymore as handle this case by showing special content on the Ada redemption screen.
@@ -299,4 +300,12 @@ export default class AdaRedemptionStore extends Store { | |||
this.decryptionKey = null; | |||
}; | |||
|
|||
_redirectToAddWalletBeforeRedemption = () => { |
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.
@DominikGuzei this is not needed anymore!
…ttps://github.com/input-output-hk/daedalus into chore/ddw-81-improve-url-handling-in-network-store
@nikolaglumac the issues with ada redemption page are fixed now! |
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.
Looks and works great 🎉
Approved 👍
@DominikGuzei awesome work! This PR is ready to be merged as soon as CI is done ;) |
This PR greatly simplifies the network status store and improves the booting UX:
NetworkStatusStore
Root
route + component which handles the conditional logic of what to display based on various statesAll tests pass as before, also tested everything with
API=etc
and there are not lint or flow issues.