summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts/can-hide-text.ts
blob: 4a4be8d9d028f3bc147a06eb45cb060c7f61b0dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export default function(note) {
	if (note.text == null) return true;

	let txt = note.text;

	if (note.media) {
		note.media.forEach(file => {
			txt = txt.replace(file.url, '');
			if (file.src) txt = txt.replace(file.src, '');
		});

		if (txt == '') return true;
	}

	return false;
}