diff options
author | 2020-02-29 02:33:08 +0800 | |
---|---|---|
committer | 2020-02-29 02:33:08 +0800 | |
commit | 1e55c527a34a5914a6d65314cf20d8c39424550f (patch) | |
tree | f9ed1171985ccc02cf50b13c6e399e839ef5fb9c /source/features/batch-open-issues.tsx | |
parent | fcc73cbaef30161e57de9841143170b06d2815f2 (diff) | |
download | refined-github-1e55c527a34a5914a6d65314cf20d8c39424550f.tar.gz refined-github-1e55c527a34a5914a6d65314cf20d8c39424550f.tar.zst refined-github-1e55c527a34a5914a6d65314cf20d8c39424550f.zip |
Small code changes to `batch-open-issues`
- Avoid title case
- Use optional chaining instead of condition
- Change button label to the more specific "Open selected"
- Add a couple of comments
Diffstat (limited to 'source/features/batch-open-issues.tsx')
-rw-r--r-- | source/features/batch-open-issues.tsx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/source/features/batch-open-issues.tsx b/source/features/batch-open-issues.tsx index 0a53a3ee..ea827372 100644 --- a/source/features/batch-open-issues.tsx +++ b/source/features/batch-open-issues.tsx @@ -38,18 +38,17 @@ function init(): void | false { delegate('.rgh-batch-open-issues', 'click', openIssues); - const filtersBar = select('.table-list-header-toggle:not(.states)'); - if (filtersBar) { - filtersBar.prepend( - <button - type="button" - className="btn-link rgh-batch-open-issues pr-2" - > - Open All - </button> - ); - } + // Add button to open all visible discussions + select('.table-list-header-toggle:not(.states)')?.prepend( + <button + type="button" + className="btn-link rgh-batch-open-issues pr-2" + > + Open all + </button> + ); + // Add button to open selected discussions const triageFiltersBar = select('.table-list-triage > .text-gray'); if (triageFiltersBar) { triageFiltersBar.classList.add('table-list-header-toggle'); // Handles link :hover style @@ -58,7 +57,7 @@ function init(): void | false { type="button" className="btn-link rgh-batch-open-issues pl-3" > - Open all + Open selected </button> ); } |