-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Exclude special search
URLs from isRepoRoot
and isRepoHome
#178
Exclude special search
URLs from isRepoRoot
and isRepoHome
#178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue is similar in complexity to #131 because /user/repo?search=1
is technically a repo home but doesn't have the DOM we expect it to have.
Since we don't actually need a standalone isRepoTreeFileFinder
, we can avoid exporting it and rename it to hasSearchParameter
.
I think we need:
_isRepoRoot
(not exported), which runs the necessary checks for the repo root, excepthasSearchParameter
isRepoRoot = () => !hasSearchParameter() && _isRepoRoot()
isRepoTree = () => _isRepoRoot() || Boolean(getRepo(url)?.path.startsWith('tree/'))
This is because currently isRepoTree
is first excluding isRepoTreeFileFinder
inside isRepoRoot
and then adding it again later. With a private _isRepoRoot
we don't need this awkward dance.
search
URLs from isRepoRoot
and isRepoHome
Thanks @kang8! |
v8 has been released. Would you like to send a PR to RG to update it? There are a few changes to make, considering all the updates included: https://github.com/refined-github/github-url-detection/releases/tag/v8.0.0 |
Yes, I will submit a PR after work. |
Fixes #173