(signal: AbortSignal)
| 129 | } |
| 130 | |
| 131 | function initBanner(signal: AbortSignal): void { |
| 132 | observe(newCommentField, async (field: HTMLElement) => { |
| 133 | // Check inside the observer because React views load after dom-ready |
| 134 | const closingDate = await getCloseDate(); |
| 135 | if (closingDate && wasLongAgo(closingDate) && (areIssuesEnabled() || areDiscussionsEnabled())) { |
| 136 | addResolvedBanner(field, closingDate); |
| 137 | } else if (isPopular() && !(await userIsModerator())) { |
| 138 | addPopularBanner(field); |
| 139 | } |
| 140 | }, {signal}); |
| 141 | } |
| 142 | |
| 143 | function makeFieldKinder(field: HTMLParagraphElement): void { |
| 144 | if (field.textContent.trim() === 'Add your comment here...') { |
nothing calls this directly
no test coverage detected