From 20917e4ae002b9d085ba0e45f6b522d463e69b00 Mon Sep 17 00:00:00 2001 From: Erallie <31375589+Erallie@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:55:30 -0700 Subject: [PATCH] added thing to avoid error with timestampHover --- main.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.ts b/main.ts index 0ea58a0..827dfa0 100644 --- a/main.ts +++ b/main.ts @@ -78,9 +78,12 @@ export default class DiscordTimestamps extends Plugin { else { newEl.appendText(textSlices[i]); } - if (i < timestampSlices.length) { + if (i < timestampSlices.length && i < timestampHover.length) { newEl.createEl('span', { text: timestampSlices[i], cls: 'discord-timestamps' }).ariaLabel = timestampHover[i] } + else if (timestampSlices.length !== timestampHover.length) { + console.error("The lengths of timestampSlices and timestampHover are NOT EQUAL!"); + } } if (text !== "") { newEl.appendText(text);