MCPcopy Index your code
hub / github.com/refined-github/refined-github / reportStatus

Function reportStatus

source/options/token-validation.tsx:17–33  ·  view source on GitHub ↗
({error, text, scopes = ['unknown']}: Status = {})

Source from the content-addressed store, hash-verified

15};
16
17function reportStatus({error, text, scopes = ['unknown']}: Status = {}): void {
18 const tokenStatus = $('#validation');
19 tokenStatus.textContent = text ?? '';
20 if (error) {
21 tokenStatus.dataset.validation = 'invalid';
22 } else {
23 delete tokenStatus.dataset.validation;
24 }
25
26 for (const scope of $$('[data-scope]')) {
27 scope.dataset.validation = scopes.includes(scope.dataset.scope!)
28 ? 'valid'
29 : scopes.includes('unknown')
30 ? ''
31 : 'invalid';
32 }
33}
34
35function getApiUrl(): string {
36 const tokenLink = $('a#personal-token-link');

Callers 1

validateTokenFunction · 0.85

Calls 1

includesMethod · 0.80

Tested by

no test coverage detected