-
Notifications
You must be signed in to change notification settings - Fork 400
Refactor addon manager #538
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
Refactor addon manager #538
Conversation
219eb16
to
566c927
Compare
src/disco/addonManager.js
Outdated
return _mozAddonManager.getAddonByID(guid) | ||
.then((addon) => { | ||
if (!addon) { | ||
return Promise.reject(new Error('Addon not found')); |
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.
You just moved this but I think this could throw
/return
instead.
if (!addon) {
throw new Error('Addon not found');
}
return addon;
566c927
to
bf89920
Compare
src/disco/addonManager.js
Outdated
if (!addon) { | ||
throw new Error('Addon not found'); | ||
} | ||
return Promise.resolve(addon); |
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 can just return addon
.
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.
Yep - good catch!
r+wc Thanks! |
bf89920
to
a19ae44
Compare
Changes the addon manager to not be a class.