Skip to content

Commit

Permalink
Add isRepliesSettings and include it in hasRichTextEditor (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocarreterom committed Oct 20, 2020
1 parent 7743dec commit f44a19b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ collect.set('isRepoMainSettings', [
'https://github.com/sindresorhus/refined-github/settings',
]);

export const isRepliesSettings = (url: URL | HTMLAnchorElement | Location = location): boolean => getCleanPathname(url).startsWith('settings/replies');
collect.set('isRepliesSettings', [
'https://github.com/settings/replies',
'https://github.com/settings/replies/88491/edit',
]);

export const isRepoTree = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepoRoot(url) || String(getRepoPath(url)).startsWith('tree/');
collect.set('isRepoTree', [
...collect.get('isRepoRoot') as string[],
Expand Down Expand Up @@ -430,7 +436,8 @@ collect.set('hasRichTextEditor', combinedTestOnly);
export const hasRichTextEditor = (url: URL | HTMLAnchorElement | Location = location): boolean =>
hasComments(url) ||
isNewIssue(url) ||
isCompare(url);
isCompare(url) ||
isRepliesSettings(url);

collect.set('hasCode', combinedTestOnly);
export const hasCode = (url: URL | HTMLAnchorElement | Location = location): boolean => // Static code, not the editor
Expand Down

0 comments on commit f44a19b

Please sign in to comment.