From 6b8c4e19cc3490091bedafe8bca9252adc3b3f39 Mon Sep 17 00:00:00 2001 From: Bauke Date: Wed, 23 Feb 2022 23:42:21 +0100 Subject: [PATCH] Fix a bug where comments without votes would end up being 'Vot'. --- source/scripts/hide-votes.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/scripts/hide-votes.ts b/source/scripts/hide-votes.ts index ce50eae..2449f07 100644 --- a/source/scripts/hide-votes.ts +++ b/source/scripts/hide-votes.ts @@ -18,6 +18,10 @@ function hideVotes(settings: Settings): number { for (const vote of commentVotes) { vote.classList.add('trx-votes-hidden'); + if (!vote.textContent!.includes(' ')) { + continue; + } + vote.textContent = vote.textContent!.slice( 0, vote.textContent!.indexOf(' '),