Skip to content

Commit 6de7548

Browse files
committed
fix(comments): 再修复低点赞的主创评论未纳入主创说的问题
1 parent f61d507 commit 6de7548

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

electron/main/services/comments/creator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,20 @@ export const getCreatorComments = async (
146146
}
147147

148148
// 并发扫描普通评论队列补充主创低赞评论,按 commentId 去重(热评优先保留);
149-
// 某页已无更多时丢弃其后各页结果
149+
// hasMore=false 的页仍有数据须先处理,处理完再丢弃其后的页
150150
const seenIds = new Set(result.map((c) => c.id));
151151
const newPages = await Promise.all(
152152
Array.from({ length: MAX_NEW_PAGES }, (_, i) => fetchNewPage(songId, i + 1)),
153153
);
154154
for (const { items, hasMore: pageHasMore } of newPages) {
155-
if (!pageHasMore) break;
156155
const hits = scanCreatorComments(items, accountMap);
157156
for (const hit of hits) {
158157
if (!seenIds.has(hit.id)) {
159158
seenIds.add(hit.id);
160159
result.push(hit);
161160
}
162161
}
162+
if (!pageHasMore) break;
163163
}
164164

165165
// 合并后按 likedCount 降序,无该字段的沉底

0 commit comments

Comments
 (0)