Conversation
4e2ea82 to
b3284c2
Compare
|
|
||
| export const isOrganizationRepo = (): boolean => exists('.AppHeader-context-full [data-hovercard-type="organization"]'); | ||
| // TODO: Remove the second check after June 2026 | ||
| export const isOrganizationRepo = (): boolean => Boolean($('qbsearch-input')?.getAttribute('data-current-org')) || exists('.AppHeader-context-full [data-hovercard-type="organization"]'); |
There was a problem hiding this comment.
Looks like the first check can also be a single selector (qbsearch-input[data-current-org]) so this can be a single exists() call
There was a problem hiding this comment.
That would be :is(qbsearch-input[data-current-org]:not[[data-current-org]=""], .AppHeader-context-full [data-hovercard-type="organization"]). Do you prefer that?
There was a problem hiding this comment.
There's no need for :is() though, right? I think I prefer it because it's more specific about what's expecting anyway, rather than the catch-all/casting Boolean()
There was a problem hiding this comment.
There's no need for :is() though, right?
Unless you want me to update exists and $ to support selector arrays, there is
There was a problem hiding this comment.
I guess you suggest to make only the first check a single exists() call
There was a problem hiding this comment.
exists('a, b')
I don't see what the issue is in that screenshot. Empty attributes can also be selected
There was a problem hiding this comment.
You can also just use exists(['a','b'].join()) to keep each line commentable. Or String([]). Or have it accept an array. I'm sure this isn't the first array of selectors in this package?
This reverts commit 6f19b57.

No description provided.