Skip to content

Commit

Permalink
added thing to avoid error with timestampHover
Browse files Browse the repository at this point in the history
  • Loading branch information
Erallie committed Nov 28, 2024
1 parent a339007 commit 20917e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 20917e4

Please sign in to comment.