Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 7a82d15

Browse files
authored
Reference commit cell uses text height (#1072)
* Reference commit cell height to text * remove sample code
1 parent 1717b14 commit 7a82d15

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Classes/Issues/ReferencedCommit/IssueReferencedCommitSectionController.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ import IGListKit
1212
final class IssueReferencedCommitSectionController: ListGenericSectionController<IssueReferencedCommitModel> {
1313

1414
override func sizeForItem(at index: Int) -> CGSize {
15-
guard let width = collectionContext?.containerSize.width else { fatalError("Missing context") }
16-
return CGSize(width: width, height: Styles.Sizes.labelEventHeight)
15+
guard let width = collectionContext?.containerSize.width,
16+
let object = self.object
17+
else { fatalError("Missing context") }
18+
return CGSize(
19+
width: width,
20+
height: object.attributedText.textViewSize(width).height
21+
)
1722
}
1823

1924
override func cellForItem(at index: Int) -> UICollectionViewCell {

Classes/Systems/Alamofire+GithubAPI.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ func newGithubClient(
2727
config.httpAdditionalHeaders = additionalHeaders
2828
config.timeoutIntervalForRequest = 15
2929

30-
if runningInSample() {
31-
config.urlCache = SampleURLCache(memoryCapacity: 1024*30, diskCapacity: 1024*50, diskPath: "sample_cache")
32-
} else {
33-
// disable URL caching for the v3 API
34-
config.requestCachePolicy = .reloadIgnoringLocalCacheData
35-
config.urlCache = nil
36-
}
30+
// disable URL caching for the v3 API
31+
config.requestCachePolicy = .reloadIgnoringLocalCacheData
32+
config.urlCache = nil
3733

3834
let networker = Alamofire.SessionManager(configuration: config)
3935

Classes/Systems/GithubSessionManager.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ final class GithubSessionManager: NSObject, ListDiffable {
3838
// if a migration occurs, immediately save to disk
3939
var migrated = false
4040

41-
if let sample = sampleUserSession() {
42-
_userSessions.add(sample)
43-
} else if let v1data = defaults.object(forKey: Keys.v1.session) as? Data,
41+
if let v1data = defaults.object(forKey: Keys.v1.session) as? Data,
4442
let session = NSKeyedUnarchiver.unarchiveObject(with: v1data) as? GithubUserSession {
4543
_userSessions.add(session)
4644

0 commit comments

Comments
 (0)