Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复IP属地显示在处理楼中楼回复时的问题 #4334

Merged
merged 5 commits into from
Jul 25, 2023

Conversation

LightQuanta
Copy link
Contributor

@LightQuanta LightQuanta commented Jul 21, 2023

刚刚发现IP属地展示在处理新版评论区的楼中楼回复时会出错(应查找.sub-reply-info>.sub-reply-time而不是.reply-info>.reply-time),已修复该问题

另外我还发现onRepliesUpdate只能处理旧版评论区的展开和翻页,对于新版评论区无效(依赖此功能的复制评论链接也受此影响)
可以将/src/components/utils/comment-apis.ts第113行开始的

childList(replyBox, () => {
  item.replies = parseReplies()
})

替换为

childList(replyBox, () => {
  item.replies = parseReplies()
  item.onRepliesUpdate?.(item.replies)
})

来对此进行修复

但这样带来了一个新问题,目前项目里使用了onRepliesUpdate这个功能的就只有我这个IP属地显示(ipShow)以及原先的复制评论链接(copyCommentsLink),也就是说原先使用此功能的只有复制评论链接这一个组件。现在我的IP属地显示同样需要使用这个功能,但onRepliesUpdate只能同时绑定一个回调函数,经测试开启复制评论链接后,IP属地显示将会无法处理新版评论区的回复更新

@LightQuanta LightQuanta changed the title Fix error in sub-reply processing 修复IP属地显示在处理楼中楼回复时的问题 Jul 21, 2023
@the1812
Copy link
Owner

the1812 commented Jul 21, 2023

另外我还发现onRepliesUpdate只能处理旧版评论区的展开和翻页,对于新版评论区无效

这个应该算 Comment API 的 bug, 等我修一修

the1812 added a commit that referenced this pull request Jul 24, 2023
- All comment items implements EventTarget
- Fix parseCommentItemV2 not dispatching repliesUpdate event
@the1812
Copy link
Owner

the1812 commented Jul 24, 2023

d641d34
已更新, 用 EventTarget 那一套增加事件就可以了

the1812 and others added 2 commits July 25, 2023 02:24
- All comment items implements EventTarget
- Fix parseCommentItemV2 not dispatching repliesUpdate event
@LightQuanta
Copy link
Contributor Author

d641d34 已更新, 用 EventTarget 那一套增加事件就可以了

ok,已经改好了

@the1812 the1812 merged commit c3021a0 into the1812:preview-features Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants