mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 02:01:02 +00:00
Make edit stickier
This commit is contained in:
parent
b93df71431
commit
b10ee3091c
3 changed files with 7 additions and 2 deletions
|
@ -57,6 +57,7 @@ public final class StatusDataControllerProvider {
|
||||||
public var isReblogged: Bool
|
public var isReblogged: Bool
|
||||||
public var isBookmarked: Bool
|
public var isBookmarked: Bool
|
||||||
public var isFavorited: Bool
|
public var isFavorited: Bool
|
||||||
|
public var content: HTMLString
|
||||||
|
|
||||||
public var favoritesCount: Int
|
public var favoritesCount: Int
|
||||||
public var reblogsCount: Int
|
public var reblogsCount: Int
|
||||||
|
@ -73,6 +74,7 @@ public final class StatusDataControllerProvider {
|
||||||
reblogsCount = status.reblogsCount
|
reblogsCount = status.reblogsCount
|
||||||
repliesCount = status.repliesCount
|
repliesCount = status.repliesCount
|
||||||
favoritesCount = status.favouritesCount
|
favoritesCount = status.favouritesCount
|
||||||
|
content = status.content
|
||||||
}
|
}
|
||||||
|
|
||||||
public func updateFrom(status: AnyStatus) {
|
public func updateFrom(status: AnyStatus) {
|
||||||
|
@ -83,6 +85,7 @@ public final class StatusDataControllerProvider {
|
||||||
reblogsCount = status.reblogsCount
|
reblogsCount = status.reblogsCount
|
||||||
repliesCount = status.repliesCount
|
repliesCount = status.repliesCount
|
||||||
favoritesCount = status.favouritesCount
|
favoritesCount = status.favouritesCount
|
||||||
|
content = status.content
|
||||||
}
|
}
|
||||||
|
|
||||||
public func toggleFavorite(remoteStatus: String?) async {
|
public func toggleFavorite(remoteStatus: String?) async {
|
||||||
|
|
|
@ -122,6 +122,7 @@ public struct StatusDetailView: View {
|
||||||
let isFocused = self.viewModel.statusId == status.id
|
let isFocused = self.viewModel.statusId == status.id
|
||||||
|
|
||||||
StatusRowView(viewModel: viewModel)
|
StatusRowView(viewModel: viewModel)
|
||||||
|
.id(status.id + (status.editedAt?.asDate.description ?? ""))
|
||||||
.environment(\.extraLeadingInset, !isCompact ? extraInsets : 0)
|
.environment(\.extraLeadingInset, !isCompact ? extraInsets : 0)
|
||||||
.environment(\.indentationLevel, !isCompact ? indentationLevel : 0)
|
.environment(\.indentationLevel, !isCompact ? indentationLevel : 0)
|
||||||
.environment(\.isStatusFocused, isFocused)
|
.environment(\.isStatusFocused, isFocused)
|
||||||
|
@ -135,7 +136,6 @@ public struct StatusDetailView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.id(status.id)
|
|
||||||
#if !os(visionOS)
|
#if !os(visionOS)
|
||||||
.listRowBackground(viewModel.highlightRowColor)
|
.listRowBackground(viewModel.highlightRowColor)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -7,13 +7,15 @@ import SwiftUI
|
||||||
struct StatusRowTextView: View {
|
struct StatusRowTextView: View {
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(\.isStatusFocused) private var isFocused
|
@Environment(\.isStatusFocused) private var isFocused
|
||||||
|
|
||||||
|
@Environment(StatusDataController.self) private var statusDataController
|
||||||
|
|
||||||
var viewModel: StatusRowViewModel
|
var viewModel: StatusRowViewModel
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
HStack {
|
HStack {
|
||||||
EmojiTextApp(viewModel.finalStatus.content,
|
EmojiTextApp(statusDataController.content,
|
||||||
emojis: viewModel.finalStatus.emojis,
|
emojis: viewModel.finalStatus.emojis,
|
||||||
language: viewModel.finalStatus.language,
|
language: viewModel.finalStatus.language,
|
||||||
lineLimit: viewModel.lineLimit)
|
lineLimit: viewModel.lineLimit)
|
||||||
|
|
Loading…
Reference in a new issue