Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix the vector web version in UserSettings #542

Merged
merged 3 commits into from
Nov 11, 2016
Merged

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Nov 8, 2016

Add a getAppVersion() function to the platform rather than relying
on the updater code firing an event before we know what the app
version is.

Requires element-hq/element-web#2553

Add a getAppVersion() function to the platform rather than relying
on the updater code firing an event before we know what the app
version is.
* the current version of the application.
*/
getAppVersion() {
return q();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about making this throw an error, so that people don't forget to implement it?

@@ -167,7 +167,6 @@ export default React.createClass({
case PageTypes.UserSettings:
page_element = <UserSettings
onClose={this.props.onUserSettingsClose}
version={this.props.version}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs removing from UserSettings.propTypes

};
},

componentWillMount: function() {
if (PlatformPeg.get()) {
PlatformPeg.get().getAppVersion().done((appVersion) => {
this.setState({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a guard against being unmounted before response

};
},

componentWillMount: function() {
if (PlatformPeg.get()) {
PlatformPeg.get().getAppVersion().done((appVersion) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a situation in which getAppVersion thows an exception, and takes out react? worth sticking a q().then in front of this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done()'s error handler is equivalent to this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it's not.

done will handle rejected promises. I'm talking about exceptions thrown synchronously by getAppVersion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I guess so. Done.

@richvdh richvdh assigned dbkr and unassigned richvdh Nov 8, 2016
@dbkr dbkr assigned richvdh and unassigned dbkr Nov 8, 2016
@dbkr
Copy link
Member Author

dbkr commented Nov 8, 2016

ptal

@richvdh richvdh assigned dbkr and unassigned richvdh Nov 8, 2016
@dbkr
Copy link
Member Author

dbkr commented Nov 8, 2016

more comments or is this good?

@dbkr dbkr assigned richvdh and unassigned dbkr Nov 8, 2016
@richvdh
Copy link
Member

richvdh commented Nov 8, 2016

See #542 (comment)

@richvdh richvdh assigned dbkr and unassigned richvdh Nov 8, 2016
@dbkr dbkr assigned richvdh and unassigned dbkr Nov 11, 2016
@richvdh richvdh merged commit 9986904 into develop Nov 11, 2016
@dbkr dbkr deleted the dbkr/get_app_version branch December 14, 2016 18:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants