Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.3k
Configure document-title during updates#1315
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
6525ca23061cbaeb427b028630d92f7cdc4899b20ef5f97cc1db09c98046178745ba7757f9b37740b91371ee5ecbb2a6f7571d6ce58b1472087774dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -5,14 +5,16 @@ import PropTypes from 'prop-types'; | ||
| class DocumentTitle extends Component { | ||
| constructor(props) { | ||
| super(props); | ||
| const {update_title} = props.config; | ||
| this.state = { | ||
| initialTitle: document.title, | ||
| update_title, | ||
| }; | ||
| } | ||
| UNSAFE_componentWillReceiveProps(props) { | ||
| if (props.isLoading) { | ||
| document.title = 'Updating...'; | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Marc-Andre-Rivet as we were discussing the other day - the renderer no longer holds this default value at all. That means when the R and Julia implementations update to include this functionality in their renderer, they will need to add this option to the back end at the same time or the default behavior will change to no title changes ever. | ||
| if (this.state.update_title && props.isLoading) { | ||
| document.title = this.state.update_title; | ||
| } else { | ||
| document.title = this.state.initialTitle; | ||
| } | ||
| @@ -29,8 +31,10 @@ class DocumentTitle extends Component { | ||
| DocumentTitle.propTypes = { | ||
| isLoading: PropTypes.bool.isRequired, | ||
| config: PropTypes.shape({update_title: PropTypes.string}), | ||
| }; | ||
| export default connect(state => ({ | ||
| isLoading: state.isLoading, | ||
| config: state.config, | ||
| }))(DocumentTitle); | ||
Uh oh!
There was an error while loading. Please reload this page.