From dd5e6b91c0b3d9ba98bdb80fc2b243592d435637 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Tue, 24 Jan 2023 06:56:28 +0100 Subject: [PATCH] oops --- .../Detail/ConversationMessageView.swift | 4 ++-- Packages/Models/Sources/Models/Status.swift | 16 ++++++++-------- .../Sources/Status/Row/StatusRowViewModel.swift | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Packages/Conversations/Sources/Conversations/Detail/ConversationMessageView.swift b/Packages/Conversations/Sources/Conversations/Detail/ConversationMessageView.swift index 07d8aaf2..00624039 100644 --- a/Packages/Conversations/Sources/Conversations/Detail/ConversationMessageView.swift +++ b/Packages/Conversations/Sources/Conversations/Detail/ConversationMessageView.swift @@ -76,7 +76,7 @@ struct ConversationMessageView: View { } } .onAppear { - isLiked = message.favorited == true + isLiked = message.favourited == true } } @@ -102,7 +102,7 @@ struct ConversationMessageView: View { status = try await client.post(endpoint: Statuses.favorite(id: message.id)) } withAnimation { - isLiked = status.favorited == true + isLiked = status.favourited == true } } catch { } } diff --git a/Packages/Models/Sources/Models/Status.swift b/Packages/Models/Sources/Models/Status.swift index 1b3637a1..73c69344 100644 --- a/Packages/Models/Sources/Models/Status.swift +++ b/Packages/Models/Sources/Models/Status.swift @@ -36,9 +36,9 @@ public protocol AnyStatus { var mentions: [Mention] { get } var repliesCount: Int { get } var reblogsCount: Int { get } - var favoritesCount: Int { get } + var favouritesCount: Int { get } var card: Card? { get } - var favorited: Bool? { get } + var favourited: Bool? { get } var reblogged: Bool? { get } var pinned: Bool? { get } var bookmarked: Bool? { get } @@ -77,9 +77,9 @@ public struct Status: AnyStatus, Decodable, Identifiable, Equatable, Hashable { public let mentions: [Mention] public let repliesCount: Int public let reblogsCount: Int - public let favoritesCount: Int + public let favouritesCount: Int public let card: Card? - public let favorited: Bool? + public let favourited: Bool? public let reblogged: Bool? public let pinned: Bool? public let bookmarked: Bool? @@ -105,9 +105,9 @@ public struct Status: AnyStatus, Decodable, Identifiable, Equatable, Hashable { mentions: [], repliesCount: 0, reblogsCount: 0, - favoritesCount: 0, + favouritesCount: 0, card: nil, - favorited: false, + favourited: false, reblogged: false, pinned: false, bookmarked: false, @@ -150,9 +150,9 @@ public struct ReblogStatus: AnyStatus, Decodable, Identifiable, Equatable, Hasha public let mentions: [Mention] public let repliesCount: Int public let reblogsCount: Int - public let favoritesCount: Int + public let favouritesCount: Int public let card: Card? - public let favorited: Bool? + public let favourited: Bool? public let reblogged: Bool? public let pinned: Bool? public let bookmarked: Bool? diff --git a/Packages/Status/Sources/Status/Row/StatusRowViewModel.swift b/Packages/Status/Sources/Status/Row/StatusRowViewModel.swift index 259d307d..91aaecd2 100644 --- a/Packages/Status/Sources/Status/Row/StatusRowViewModel.swift +++ b/Packages/Status/Sources/Status/Row/StatusRowViewModel.swift @@ -44,17 +44,17 @@ public class StatusRowViewModel: ObservableObject { self.isRemote = isRemote self.showActions = showActions if let reblog = status.reblog { - isFavorited = reblog.favorited == true + isFavorited = reblog.favourited == true isReblogged = reblog.reblogged == true isPinned = reblog.pinned == true isBookmarked = reblog.bookmarked == true } else { - isFavorited = status.favorited == true + isFavorited = status.favourited == true isReblogged = status.reblogged == true isPinned = status.pinned == true isBookmarked = status.bookmarked == true } - favoritesCount = status.reblog?.favoritesCount ?? status.favoritesCount + 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 @@ -209,17 +209,17 @@ public class StatusRowViewModel: ObservableObject { private func updateFromStatus(status: Status) { if let reblog = status.reblog { - isFavorited = reblog.favorited == true + isFavorited = reblog.favourited == true isReblogged = reblog.reblogged == true isPinned = reblog.pinned == true isBookmarked = reblog.bookmarked == true } else { - isFavorited = status.favorited == true + isFavorited = status.favourited == true isReblogged = status.reblogged == true isPinned = status.pinned == true isBookmarked = status.bookmarked == true } - favoritesCount = status.reblog?.favoritesCount ?? status.favoritesCount + favoritesCount = status.reblog?.favouritesCount ?? status.favouritesCount reblogsCount = status.reblog?.reblogsCount ?? status.reblogsCount repliesCount = status.reblog?.repliesCount ?? status.repliesCount }