summaryrefslogtreecommitdiff
path: root/source/features/batch-open-issues.tsx
diff options
context:
space:
mode:
authorGravatar Federico Brigante <github@bfred.it> 2020-02-29 02:33:08 +0800
committerGravatar GitHub <noreply@github.com> 2020-02-29 02:33:08 +0800
commit1e55c527a34a5914a6d65314cf20d8c39424550f (patch)
treef9ed1171985ccc02cf50b13c6e399e839ef5fb9c /source/features/batch-open-issues.tsx
parentfcc73cbaef30161e57de9841143170b06d2815f2 (diff)
downloadrefined-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.tsx23
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>
);
}