Skip to content

Commit

Permalink
fix: comment not rendered when comment size is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
xpadev-net committed Aug 14, 2024
1 parent c2b5e62 commit bd65204
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class NiconiComments {
right: [],
};
this.lastVpos = -1;
this.processedCommentIndex = 0;
this.processedCommentIndex = -1;

this.comments = this.preRendering(parsedData);

Expand Down Expand Up @@ -197,7 +197,7 @@ class NiconiComments {
private getCommentPos(data: IComment[], end: number, lazy = false) {
const getCommentPosStart = performance.now();
if (this.processedCommentIndex + 1 >= end) return;
for (const comment of data.slice(this.processedCommentIndex, end)) {
for (const comment of data.slice(this.processedCommentIndex + 1, end)) {
if (comment.invisible || (comment.posY > -1 && !lazy)) continue;
if (comment.loc === "naka") {
processMovableComment(comment, this.collision, this.timeline, lazy);
Expand Down

0 comments on commit bd65204

Please sign in to comment.