Skip to content

[BUG] getSiteByReference returning incorrect site when siteRef and site.alias are both undefined #2477

@johnnygreen

Description

@johnnygreen

Summary

if siteRef on #131 returns undefined ... later down in #158 getSiteByReference ... this will erroneously return the first site with an undefined site.alias instead of defaultSite (edited)

Steps To Reproduce

have two sites in site config, with the 2nd site in the list being the default site in config. then do not have siteId represented in the URL, which will trigger siteRef to be undefined. then call getSiteByReference(undefined) to see site with site.alias as undefined is returned instead of defaultSite.

Expected result

Describe what should have happened.

it should return the correct defaultSite

Describe what actually happened.

it returns the first site with undefined site.alias

pwa-kit version: latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions