-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Restore lock icons on private orgs #2211
Conversation
They should be iterable; if this happens there must be a problem in the API or in the cache module. Can you show me exactly what It seems to work for me in Chrome and Firefox |
Perhaps “not iterable” was a poor choice of words, but I wasn’t sure other words to use to describe it when I was debugging. When I was And so I figured I would iterate through the keys, and it seemed that sometimes I was getting let publicOrgs = await api.v3(`users/${getUsername()}/orgs`);
// console.log's to see the contents of `publicOrgs` response
console.log(publicOrgs)
for (let key in publicOrgs) {
console.log('key: ', key)
}
publicOrgs = Object.values(publicOrgs).map((orgData: AnyObject) => `/${orgData.login}`); As you see in the screenshot, we are getting the keys of:
It seems that So I figured I would just use I'm getting similar behavior in both Brave (Chromium) and Firefox. So yea, not entirely sure what’s happening, but I figured I would attempt to fix it maybe get some feedback in the code review on why |
It is because the API itself returns an |
@jerone that’s funny 😅 good catch The solution is to use |
This reverts commit 38e0e33.
67e8870
to
cccae84
Compare
What
Fixes #2210
Notes
After some digging, it seems as though the response from GitHub's API changed a bit(?), and some of the keys in the response aren't iterable. 🤔
This just uses an explicit
Object.values
around thepublicOrgs
response object. 😄Before
After