mirror of
https://github.com/sagidayan/greasemonkey-scripts.git
synced 2024-11-22 09:25:26 +00:00
Fixed issue when there are no PR checks
This commit is contained in:
parent
2e2ad9556a
commit
bbdc60dd42
1 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
|||
// @description A brief description of your script
|
||||
// @namespace http://arantius.com/misc/greasemonkey/
|
||||
// @author Sagi Dayan
|
||||
// @match https://github.com/*
|
||||
// @match https://github.com/*
|
||||
// @version 1.0
|
||||
// ==/UserScript==
|
||||
|
||||
|
@ -50,7 +50,7 @@ setInterval(() => {
|
|||
|
||||
function createPrHTML(pr) {
|
||||
const div = document.createElement('div');
|
||||
const prState = pr.commits.nodes[0].commit.statusCheckRollup.state;
|
||||
const prState = pr.commits.nodes[0].commit.statusCheckRollup?.state || '';
|
||||
const prStateColor = prState === 'FAILURE' ? 'red' : (prState === 'SUCCESS' ? 'green' : 'yellow');
|
||||
|
||||
div.className = "d-sm-flex Box mb-2 Box-body color-bg-secondary";
|
||||
|
@ -69,4 +69,4 @@ function createPrHTML(pr) {
|
|||
</div>
|
||||
`;
|
||||
return div;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue