-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Move 'new version' support into Platform #2532
Conversation
dbkr
commented
Nov 2, 2016
- Allow platforms to specify release notes
- Make web update checking much, much simpler (ie. not manually using XMLHTTPRequest)
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.
Is there another bit of this that wires up new_version
?
onFinished: (update) => { | ||
if(update) { | ||
window.location.reload(); | ||
if (props.releaseNotes) { |
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.
nit: I feel like this should be two separate functions
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.
still think this needs splitting
Oh, found it: matrix-org/matrix-react-sdk#532 |
For template methods that are only used from within vector (ie. new version support)
onFinished: (update) => { | ||
if(update) { | ||
window.location.reload(); | ||
if (props.releaseNotes) { |
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.
still think this needs splitting
Modal.createDialog(ChangelogDialog, { | ||
version: props.version, | ||
newVersion: props.newVersion, | ||
releaseNotes: releaseNotes, |
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.
releaseNotes
seems to be undefined here.
if (checkVersion(props.version) && checkVersion(props.newVersion)) { | ||
changelog_button = <button className="mx_MatrixToolbar_action" onClick={onChangelogClicked}>Changelog</button>; | ||
let action_button; | ||
if (props.releaseNotes || (checkVersion(props.version) && checkVersion(props.newVersion))) { |
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 could do with a comment here explaining that we show a questiondialog if we have releasenotes, or a changelogdialog if we don't.
and change the class to use React createClass syntax while I'm at it, rather than a completely different third style we use nowhere else in the project.
ptal |
releaseNotes: React.PropTypes.string, | ||
}, | ||
|
||
onChangelogClicked: function() { |
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.
better but why not just bind displayReleaseNotes
or displayChangelog
to the button in render
instead, since you're already doing the conditions there?
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.
lgtm otherwise
rather than deciding in onChangelogClicked