Exclude special search URLs from isRepoRoot and isRepoHome#178
Conversation
There was a problem hiding this comment.
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, excepthasSearchParameterisRepoRoot = () => !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