Skip to content

Commit

Permalink
contribution 파싱에러 수정 (#78)
Browse files Browse the repository at this point in the history
contribution 파싱에러 수정
  • Loading branch information
87kangsw committed Jan 7, 2023
1 parent 73127fe commit c7bff99
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,15 @@ final class ActivityViewReactor: ReactorKit.Reactor {
if let doc = try? HTML(html: response.data, encoding: .utf8) {
for rect in doc.css("rect") {
if var date = rect["data-date"],
var count = rect["data-count"],
let dataLevel = rect["data-level"] {

date = date.replacingOccurrences(of: "\\", with: "")
.replacingOccurrences(of: "/", with: "")
.replacingOccurrences(of: "\"", with: "")
count = count.replacingOccurrences(of: "\\", with: "")
.replacingOccurrences(of: "\"", with: "")

let colorType = ContributionHexColorTypes.allCases.first { $0.rawValue == Int(dataLevel) }
if let hexString = colorType?.hexString {
contributions.append(Contribution(date: date, contribution: Int(count)!, hexColor: hexString))
contributions.append(Contribution(date: date, contribution: Int(dataLevel)!, hexColor: hexString))
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions GitTime/Sources/ViewControllers/Buddy/BuddyViewReactor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,18 +257,15 @@ final class BuddyViewReactor: Reactor {
if let doc = try? HTML(html: response.data, encoding: .utf8) {
for rect in doc.css("rect") {
if var date = rect["data-date"],
var count = rect["data-count"],
let dataLevel = rect["data-level"] {

date = date.replacingOccurrences(of: "\\", with: "")
.replacingOccurrences(of: "/", with: "")
.replacingOccurrences(of: "\"", with: "")
count = count.replacingOccurrences(of: "\\", with: "")
.replacingOccurrences(of: "\"", with: "")

let colorType = ContributionHexColorTypes.allCases.first { $0.rawValue == Int(dataLevel) }
if let hexString = colorType?.hexString {
contributions.append(Contribution(date: date, contribution: Int(count)!, hexColor: hexString))
contributions.append(Contribution(date: date, contribution: Int(dataLevel)!, hexColor: hexString))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions GitTime/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.1.4</string>
<string>2.1.5</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -100,7 +100,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3</string>
<string>4</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 889e35fd688c78c4e6f036a683a2aed3bbd554c6

COCOAPODS: 1.11.2
COCOAPODS: 1.11.3

0 comments on commit c7bff99

Please sign in to comment.