summaryrefslogtreecommitdiff
path: root/source/features/hide-empty-meta.tsx
blob: dee0f6803a1c2b81716de4cf5d265b7a72a97af7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import select from 'select-dom';
import features from '../libs/features';
import * as pageDetect from '../libs/page-detect';

function init(): void {
	// Hide if it’s not editable by the current user
	if (select.exists('.repository-content > :first-child:not(#repo-meta-edit) em')) {
		select('.repository-content')!.firstElementChild!.remove();
	}
}

features.add({
	id: __filebasename,
	description: 'Hides the placeholder text in repos without a description.',
	screenshot: false
}, {
	include: [
		pageDetect.isRepoRoot
	],
	init
});