async getAssignedSites()

in src/js/background/assignManager.js [109:129]


    async getAssignedSites(userContextId = null) {
      const sites = {};
      const siteConfigs = await this.area.get();
      for(const urlKey of Object.keys(siteConfigs)) {
        if (urlKey.includes("siteContainerMap@@_")) {
        // For some reason this is stored as string... lets check
        // them both as that
          if (!!userContextId &&
              String(siteConfigs[urlKey].userContextId)
                !== String(userContextId)) {
            continue;
          }
          const site = siteConfigs[urlKey];
          // In hindsight we should have stored this
          // TODO file a follow up to clean the storage onLoad
          site.hostname = urlKey.replace(/^siteContainerMap@@_/, "");
          sites[urlKey] = site;
        }
      }
      return sites;
    },