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

Timeline 树洞预览之间的间距在数据更新后不会及时更新 #15

Open
Cydiater opened this issue Sep 26, 2021 · 3 comments
Open
Labels
bug Something isn't working

Comments

@Cydiater
Copy link
Contributor

复现方法:

  1. 进入一个回复条目小于 2 的树洞
  2. 回复一条消息
  3. 返回首页

一个例子
https://cloud.tsinghua.edu.cn/f/3949d6cfe2c74fb6b2da/

@liang2kl
Copy link
Collaborator

问题在这里:

.fixedSize(horizontal: false, vertical: true)

因为有 fixedSize。如果没有 fixedSize 的话,数据更新之后间距会出现另一种问题(变大),所以一直没改,不过可能还是要考虑改一下。

这实际上是 SwiftUI 的 bug。

@liang2kl
Copy link
Collaborator

liang2kl commented Sep 27, 2021

取消 fixedSize 后 Bug 如图所示

Simulator Screen Shot - iPhone 12 - 2021-09-27 at 18 30 56

@liang2kl
Copy link
Collaborator

db26370 修改了 HollowDetailStore 中 Binding 的逻辑,使得详情加载后不会将新增的评论赋值给 list 所用的数据:

bindingCancellable = $postDataWrapper
.receive(on: DispatchQueue.main)
.sink { post in
var post = post
// FIXME: Updating Comments
// Use original comments, as comments change will cause
// the post card to be misplaced in List.
post.post.comments = bindingPostWrapper.post.comments.wrappedValue
bindingPostWrapper.wrappedValue = post
}

我其实很不喜欢这种方法,但是目前来看暂时只能这样解决了,等苹果修复了之后再改回去吧,这个 issue 暂时就不 close 了。

@liang2kl liang2kl added the bug Something isn't working label Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants