-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add Reconnect UI to ConnectivityStatus when connection has been interrupted #1895
Conversation
In
|
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.
As commented.
}) | ||
}); | ||
|
||
await driver.sleep(17000); |
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 need to wait 17 seconds?
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 test is waiting for the 'slow to connect' timeout, which is the 17 seconds. I'm not sure if there's any way to circumvent the timeout during tests, but if there is please let me know and I can fix it.
debounce={ (connectivityStatus === 'uninitialized' || connectivityStatus === 'error') ? 0 : 400 }> | ||
{ () => | ||
connectivityStatus === 'connectingslow' ? | ||
<React.Fragment> |
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.
Are you able to render a single React.Fragment outside the chained ternary like this?
() => {
<React.Fragment>
{
connectivityStatus === 'connectingslow' ?
<WarningNotificationIcon />
: (connectivityStatus === 'error' || connectivityStatus === 'notconnected') ?
<ErrorNotificationIcon />
: connectivityStatus === 'uninitialized' ?
<SpinnerAnimation />
{ localize('INITIAL_CONNECTION_NOTIFICATION', language) }
}
</React.Fragment>
}
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 don't think this will work because each status also has different text to be localized, and you can't return multiple children, only one.
this gives errors:
<React.Fragment>
{
connectivityStatus === 'connectingslow' ?
<WarningNotificationIcon />
{ localize('SLOW_CONNECTION_NOTIFICATION', language) }
: (connectivityStatus === 'error' || connectivityStatus === 'notconnected') ?
<ErrorNotificationIcon />
{ localize('FAILED_CONNECTION_NOTIFICATION', language) }
: connectivityStatus === 'uninitialized' ?
<SpinnerAnimation />
{ localize('INITIAL_CONNECTION_NOTIFICATION', language) }
}
</React.Fragment>
}
Playing around with parenthesis didn't get rid of the errors. Let me know if I should try something else. :)
PR modifications have been pushed up, with an added fix: |
@cwhitten could you take another pass when you have a chance? Thank you! |
Resolves #1523
Resolves #1831
defaultStyleSetOptions.js