mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-27 12:59:17 +01:00
Force update status detail
This commit is contained in:
parent
e192135f37
commit
ffda5fe6f0
@ -41,7 +41,7 @@ public struct StatusDetailView: View {
|
||||
case .loading:
|
||||
loadingDetailView
|
||||
|
||||
case let .display(status, context):
|
||||
case let .display(status, context, date):
|
||||
if !context.ancestors.isEmpty {
|
||||
ForEach(context.ancestors) { ancestor in
|
||||
StatusRowView(viewModel: .init(status: ancestor, isCompact: false))
|
||||
@ -49,6 +49,7 @@ public struct StatusDetailView: View {
|
||||
}
|
||||
|
||||
makeCurrentStatusView(status: status)
|
||||
.id(date)
|
||||
|
||||
if !context.descendants.isEmpty {
|
||||
ForEach(context.descendants) { descendant in
|
||||
|
@ -11,7 +11,7 @@ class StatusDetailViewModel: ObservableObject {
|
||||
var client: Client?
|
||||
|
||||
enum State {
|
||||
case loading, display(status: Status, context: StatusContext), error(error: Error)
|
||||
case loading, display(status: Status, context: StatusContext, date: Date), error(error: Error)
|
||||
}
|
||||
|
||||
@Published var state: State = .loading
|
||||
@ -25,7 +25,7 @@ class StatusDetailViewModel: ObservableObject {
|
||||
}
|
||||
|
||||
init(status: Status) {
|
||||
state = .display(status: status, context: .empty())
|
||||
state = .display(status: status, context: .empty(), date: Date())
|
||||
title = "status.post-from-\(status.account.displayNameWithoutEmojis)"
|
||||
statusId = status.id
|
||||
remoteStatusURL = nil
|
||||
@ -75,10 +75,10 @@ class StatusDetailViewModel: ObservableObject {
|
||||
title = "status.post-from-\(data.status.account.displayNameWithoutEmojis)"
|
||||
if animate {
|
||||
withAnimation {
|
||||
state = .display(status: data.status, context: data.context)
|
||||
state = .display(status: data.status, context: data.context, date: Date())
|
||||
}
|
||||
} else {
|
||||
state = .display(status: data.status, context: data.context)
|
||||
state = .display(status: data.status, context: data.context,date: Date())
|
||||
scrollToId = statusId
|
||||
}
|
||||
} catch {
|
||||
|
Loading…
x
Reference in New Issue
Block a user