SwiftcordApp/Swiftcord

Messages sometimes do not load when channels are switched

Closed this issue · 2 comments

(This is almost definitely a SwiftUI bug) If the message list is scrolled up, and the channel is changed, the placeholder sometimes does not load and hence no messages load.

This is due to the list still being stuck at the original scroll position even though there is no more content there, which causes the messages placeholder not to load. Due to how I design message loading, the messages do not load if the placeholder doesn't appear.

However, when the window is resized, it causes the scrollView to recalculate something and it suddenly realises the content height changed. Then it scrolls to where it should be, the placeholder appears and the messages load. This further compounds my suspicion that this is a SwiftUI bug.

This can probably be fixed by changing the initial message loading to be triggered when the channel changes, and not solely rely on the placeholder appearing.

The major UI architecture changes might just fix this tho...