blob: 17eb68790597290b29bb13fac58e169c00e0e629 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import select from 'select-dom';
import * as pageDetect from 'github-url-detection';
import features from '../libs/features';
import onNewComments from '../libs/on-new-comments';
function init(): void {
// Selects all the deployments first so that we can leave the last one on the page
const deployments = select.all('.js-socket-channel[data-url$="/pull_requests/events/deployed"]');
deployments.pop(); // Don't hide the last deployment, even if it is inactive
for (const deployment of deployments) {
if (select.exists('[title="Deployment Status Label: Inactive"]', deployment)) {
deployment.remove();
}
}
}
features.add({
id: __filebasename,
description: 'Hides inactive deployments in PRs.',
screenshot: 'https://github.com/sindresorhus/refined-github/issues/1144'
}, {
include: [
pageDetect.isPRConversation
],
additionalListeners: [
onNewComments
],
init
});
|