g-comments 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2394,7 +2394,7 @@ var CommentThread = class {
2394
2394
  if (!insertable(comment) || this.#deletedAt.has(comment.id)) {
2395
2395
  continue;
2396
2396
  }
2397
- const parentNumber = comment.reply_to?.number;
2397
+ const parentNumber = this.#state.thread.nested ? comment.reply_to?.number : void 0;
2398
2398
  if (parentNumber === void 0) {
2399
2399
  if (me !== null && comment.author?.id === me) {
2400
2400
  tree = insertRoot(tree, comment, rootPosition(sort));
@@ -2472,7 +2472,7 @@ var CommentThread = class {
2472
2472
  this.#record({ kind: "comments", comments: [comment], insertable: /* @__PURE__ */ new Set([comment.id]), ticket });
2473
2473
  const sort = this.#state.sort;
2474
2474
  let comments = this.#state.comments;
2475
- if (replyTo !== void 0) {
2475
+ if (replyTo !== void 0 && this.#state.thread.nested) {
2476
2476
  comments = insertReply(comments, replyTo, comment, replyPosition(sort), { bumpCounts: true }) ?? comments;
2477
2477
  } else {
2478
2478
  comments = insertRoot(comments, comment, rootPosition(sort));
@@ -3077,6 +3077,7 @@ exports.currentUrlWithoutHash = currentUrlWithoutHash;
3077
3077
  exports.defaultPageUrl = defaultPageUrl;
3078
3078
  exports.en = en;
3079
3079
  exports.encodeRef = encodeRef;
3080
+ exports.findByNumber = findByNumber;
3080
3081
  exports.findComment = findComment;
3081
3082
  exports.isCommentsError = isCommentsError;
3082
3083
  exports.isVirtualThread = isVirtualThread;
@@ -3085,5 +3086,5 @@ exports.memoryStorage = memoryStorage;
3085
3086
  exports.normalizeForum = normalizeForum;
3086
3087
  exports.ptBR = ptBR;
3087
3088
  exports.resolveLocale = resolveLocale;
3088
- //# sourceMappingURL=chunk-IBNNENCZ.cjs.map
3089
- //# sourceMappingURL=chunk-IBNNENCZ.cjs.map
3089
+ //# sourceMappingURL=chunk-I2L3IAXL.cjs.map
3090
+ //# sourceMappingURL=chunk-I2L3IAXL.cjs.map