mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-25 14:32:20 +01:00
Various timeline fixes for smoother scrolling
This commit is contained in:
parent
64bee206b9
commit
41fdb3adde
@ -73,9 +73,6 @@ public struct StatusRowView: View {
|
||||
await viewModel.loadEmbeddedStatus()
|
||||
}
|
||||
}
|
||||
if preferences.autoExpandSpoilers == true && viewModel.displaySpoiler {
|
||||
viewModel.displaySpoiler = false
|
||||
}
|
||||
}
|
||||
}
|
||||
.contextMenu {
|
||||
|
@ -39,7 +39,7 @@ public class StatusRowViewModel: ObservableObject {
|
||||
|
||||
private let theme = Theme.shared
|
||||
|
||||
var seen = false
|
||||
private var seen = false
|
||||
|
||||
var filter: Filtered? {
|
||||
status.reblog?.filtered?.first ?? status.filtered?.first
|
||||
@ -87,7 +87,11 @@ public class StatusRowViewModel: ObservableObject {
|
||||
favoritesCount = status.reblog?.favouritesCount ?? status.favouritesCount
|
||||
reblogsCount = status.reblog?.reblogsCount ?? status.reblogsCount
|
||||
repliesCount = status.reblog?.repliesCount ?? status.repliesCount
|
||||
displaySpoiler = !(status.reblog?.spoilerText.asRawText ?? status.spoilerText.asRawText).isEmpty
|
||||
if UserPreferences.shared.autoExpandSpoilers {
|
||||
displaySpoiler = false
|
||||
} else {
|
||||
displaySpoiler = !(status.reblog?.spoilerText.asRawText ?? status.spoilerText.asRawText).isEmpty
|
||||
}
|
||||
|
||||
isFiltered = filter != nil
|
||||
}
|
||||
@ -95,8 +99,13 @@ public class StatusRowViewModel: ObservableObject {
|
||||
func markSeen() {
|
||||
// called in on appear so we can cache that the status has been seen.
|
||||
if UserPreferences.shared.suppressDupeReblogs && !seen {
|
||||
ReblogCache.shared.cache(status, seen: true)
|
||||
seen = true
|
||||
DispatchQueue.global().async { [weak self] in
|
||||
guard let self else { return }
|
||||
ReblogCache.shared.cache(self.status, seen: true)
|
||||
Task { @MainActor in
|
||||
self.seen = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user