mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-05-24 08:54:10 +08:00
warm label event size caches (#1090)
This commit is contained in:
@@ -350,7 +350,8 @@ extension GithubClient {
|
||||
date: Date(),
|
||||
type: .added,
|
||||
repoOwner: owner,
|
||||
repoName: repo
|
||||
repoName: repo,
|
||||
width: 0
|
||||
))
|
||||
}
|
||||
}
|
||||
@@ -364,7 +365,8 @@ extension GithubClient {
|
||||
date: Date(),
|
||||
type: .removed,
|
||||
repoOwner: owner,
|
||||
repoName: repo
|
||||
repoName: repo,
|
||||
width: 0
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,8 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsIssue: Is
|
||||
date: date,
|
||||
type: .removed,
|
||||
repoOwner: owner,
|
||||
repoName: repo
|
||||
repoName: repo,
|
||||
width: width
|
||||
)
|
||||
results.append(model)
|
||||
} else if let labeled = node.asLabeledEvent,
|
||||
@@ -106,7 +107,8 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsIssue: Is
|
||||
date: date,
|
||||
type: .added,
|
||||
repoOwner: owner,
|
||||
repoName: repo
|
||||
repoName: repo,
|
||||
width: width
|
||||
)
|
||||
results.append(model)
|
||||
} else if let closed = node.asClosedEvent,
|
||||
|
||||
@@ -32,7 +32,8 @@ final class IssueLabeledModel: ListDiffable {
|
||||
date: Date,
|
||||
type: EventType,
|
||||
repoOwner: String,
|
||||
repoName: String
|
||||
repoName: String,
|
||||
width: CGFloat
|
||||
) {
|
||||
self.id = id
|
||||
self.actor = actor
|
||||
@@ -94,7 +95,7 @@ final class IssueLabeledModel: ListDiffable {
|
||||
// Set
|
||||
|
||||
self.attributedString = NSAttributedStringSizing(
|
||||
containerWidth: 0,
|
||||
containerWidth: width,
|
||||
attributedText: attributedString,
|
||||
inset: IssueLabeledCell.insets,
|
||||
backgroundColor: Styles.Colors.Gray.lighter.color
|
||||
|
||||
@@ -99,7 +99,8 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsPullReque
|
||||
date: date,
|
||||
type: .removed,
|
||||
repoOwner: owner,
|
||||
repoName: repo
|
||||
repoName: repo,
|
||||
width: width
|
||||
)
|
||||
results.append(model)
|
||||
} else if let labeled = node.asLabeledEvent,
|
||||
@@ -112,7 +113,8 @@ extension IssueOrPullRequestQuery.Data.Repository.IssueOrPullRequest.AsPullReque
|
||||
date: date,
|
||||
type: .added,
|
||||
repoOwner: owner,
|
||||
repoName: repo
|
||||
repoName: repo,
|
||||
width: width
|
||||
)
|
||||
results.append(model)
|
||||
} else if let closed = node.asClosedEvent,
|
||||
|
||||
@@ -50,7 +50,7 @@ final class CodeView: UIScrollView {
|
||||
func set(attributedCode: NSAttributedString) {
|
||||
textView.attributedText = attributedCode
|
||||
let max = CGFloat.greatestFiniteMagnitude
|
||||
let size = textVi ew.sizeThatFits(CGSize(width: max, height: max))
|
||||
let size = textView.sizeThatFits(CGSize(width: max, height: max))
|
||||
textView.frame = CGRect(origin: .zero, size: size)
|
||||
contentSize = size
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user