Skip to content

Commit

Permalink
Fixes for bluesky bridge support
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed Jul 4, 2023
1 parent e33dcdf commit a97868c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ struct AccountDetailHeaderView: View {
scrollViewProxy?.scrollTo("status", anchor: .top)
}
} label: {
makeCustomInfoLabel(title: "account.posts", count: account.statusesCount)
makeCustomInfoLabel(title: "account.posts", count: account.statusesCount ?? 0)
}
.accessibilityHint("accessibility.tabs.profile.post-count.hint")
.buttonStyle(.borderless)

Button {
routerPath.navigate(to: .following(id: account.id))
} label: {
makeCustomInfoLabel(title: "account.following", count: account.followingCount)
makeCustomInfoLabel(title: "account.following", count: account.followingCount ?? 0)
}
.accessibilityHint("accessibility.tabs.profile.following-count.hint")
.buttonStyle(.borderless)
Expand All @@ -143,7 +143,7 @@ struct AccountDetailHeaderView: View {
} label: {
makeCustomInfoLabel(
title: "account.followers",
count: account.followersCount,
count: account.followersCount ?? 0,
needsBadge: currentAccount.account?.id == account.id && !currentAccount.followRequests.isEmpty
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public struct AccountsListRow: View {

// First parameter is the number for the plural
// 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)

if let field = viewModel.account.fields.filter({ $0.verifiedAt != nil }).first {
Expand Down
6 changes: 3 additions & 3 deletions Packages/Models/Sources/Models/Account.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ public final class Account: Codable, Identifiable, Hashable, Sendable, Equatable
public let acct: String
public let note: HTMLString
public let createdAt: ServerDate
public let followersCount: Int
public let followingCount: Int
public let statusesCount: Int
public let followersCount: Int?
public let followingCount: Int?
public let statusesCount: Int?
public let lastStatusAt: String?
public let fields: [Field]
public let locked: Bool
Expand Down

0 comments on commit a97868c

Please sign in to comment.