Skip to content
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

Small fixes #2572

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Small fixes #2572

merged 2 commits into from
Sep 26, 2024

Conversation

Cimbali
Copy link
Contributor

@Cimbali Cimbali commented Sep 12, 2023

I was going over the code to look at writing up some PRs and stumbled across 2 small easily corrected issues:

  • a Promise’s resolve() being called twice, which is meaningless.
    Note that I’ve checked that using else for fallback/function exit is OK per style, see e.g.
    if (url.port === "80" || url.port === "443") {
    return `${storagePrefix}${url.hostname}`;
    } else {
    return `${storagePrefix}${url.hostname}${url.port}`;
    }
  • A function call to getByContainer() which doesn’t exist (there is a getAssignedSites() which in turn calls _getByContainer())

@@ -61,8 +61,9 @@ window.assignManager = {
this.area.get([siteStoreKey]).then((storageResponse) => {
if (storageResponse && siteStoreKey in storageResponse) {
resolve(storageResponse[siteStoreKey]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would add a return here instead.

@bakulf bakulf merged commit 037a804 into mozilla:main Sep 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants