Fixes for bluesky bridge support

This commit is contained in:
Thomas Ricouard 2023-07-04 08:37:30 +02:00
parent e33dcdf372
commit a97868cab7
3 changed files with 7 additions and 7 deletions

View File

@ -125,7 +125,7 @@ struct AccountDetailHeaderView: View {
scrollViewProxy?.scrollTo("status", anchor: .top) scrollViewProxy?.scrollTo("status", anchor: .top)
} }
} label: { } label: {
makeCustomInfoLabel(title: "account.posts", count: account.statusesCount) makeCustomInfoLabel(title: "account.posts", count: account.statusesCount ?? 0)
} }
.accessibilityHint("accessibility.tabs.profile.post-count.hint") .accessibilityHint("accessibility.tabs.profile.post-count.hint")
.buttonStyle(.borderless) .buttonStyle(.borderless)
@ -133,7 +133,7 @@ struct AccountDetailHeaderView: View {
Button { Button {
routerPath.navigate(to: .following(id: account.id)) routerPath.navigate(to: .following(id: account.id))
} label: { } label: {
makeCustomInfoLabel(title: "account.following", count: account.followingCount) makeCustomInfoLabel(title: "account.following", count: account.followingCount ?? 0)
} }
.accessibilityHint("accessibility.tabs.profile.following-count.hint") .accessibilityHint("accessibility.tabs.profile.following-count.hint")
.buttonStyle(.borderless) .buttonStyle(.borderless)
@ -143,7 +143,7 @@ struct AccountDetailHeaderView: View {
} label: { } label: {
makeCustomInfoLabel( makeCustomInfoLabel(
title: "account.followers", title: "account.followers",
count: account.followersCount, count: account.followersCount ?? 0,
needsBadge: currentAccount.account?.id == account.id && !currentAccount.followRequests.isEmpty needsBadge: currentAccount.account?.id == account.id && !currentAccount.followRequests.isEmpty
) )
} }

View File

@ -53,7 +53,7 @@ public struct AccountsListRow: View {
// First parameter is the number for the plural // First parameter is the number for the plural
// Second parameter is the formatted string to show // Second parameter is the formatted string to show
Text("account.label.followers \(viewModel.account.followersCount) \(viewModel.account.followersCount, format: .number.notation(.compactName))") Text("account.label.followers \(viewModel.account.followersCount ?? 0) \(viewModel.account.followersCount ?? 0, format: .number.notation(.compactName))")
.font(.scaledFootnote) .font(.scaledFootnote)
if let field = viewModel.account.fields.filter({ $0.verifiedAt != nil }).first { if let field = viewModel.account.fields.filter({ $0.verifiedAt != nil }).first {

View File

@ -47,9 +47,9 @@ public final class Account: Codable, Identifiable, Hashable, Sendable, Equatable
public let acct: String public let acct: String
public let note: HTMLString public let note: HTMLString
public let createdAt: ServerDate public let createdAt: ServerDate
public let followersCount: Int public let followersCount: Int?
public let followingCount: Int public let followingCount: Int?
public let statusesCount: Int public let statusesCount: Int?
public let lastStatusAt: String? public let lastStatusAt: String?
public let fields: [Field] public let fields: [Field]
public let locked: Bool public let locked: Bool