-
Notifications
You must be signed in to change notification settings - Fork 90
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
Fix confusing download dialog popup #599
Conversation
@@ -903,7 +905,7 @@ class InstalledTool { | |||
* @param version Version of the tool, expected to be either SemVer or PVP versioned. | |||
* @param installed Is this tool currently installed? | |||
*/ | |||
public constructor(readonly name: string, readonly version: string = '', readonly installed: boolean = true) { | |||
public constructor(readonly name: string, readonly version?: string, readonly installed: boolean = true) { | |||
this.nameWithVersion = `${name}-${version}`; |
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 will render now as "*-undefined" if it is ever shown which isn't much better, imo.
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.
Yeah, I don't like this class, because we create an instance even if there is no such version. It obscures control flow. I'll have more time this evening.
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 will render now as "*-undefined" if it is ever shown which isn't much better, imo.
Well, if there's undefined falling through in this codepath, then that's a bug. Because undefined
in this context means "default" and should have been resolved before.
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.
But I also suck hard at OOP, so.
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 like this class
Yeah, it is basically a record, not really a class.
Anyway, I prefer it over the unnamed tuple it was before :)
Because undefined in this context means "default" and should have been resolved before.
True
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, thanks for the quick fix!
Fixes #597