Compare commits
3 Commits
9ab95dfc43
...
e7e141bd1e
Author | SHA1 | Date |
---|---|---|
Shadowfacts | e7e141bd1e | |
Shadowfacts | 8386e9d3c6 | |
Shadowfacts | 21e4828a72 |
|
@ -1,5 +1,12 @@
|
|||
# Changelog
|
||||
|
||||
## 2021.1 (19)
|
||||
This is an emergency fix for Tusker breaking when connecting to Mastodon instances on 3.4.0rc1.
|
||||
|
||||
Bugfixes:
|
||||
- Fix crash when connecting to Mastodon 3.4.0rc1
|
||||
- Fix crash when loading notifications fails
|
||||
|
||||
## 2021.1 (18)
|
||||
Polls! They're finally here. There will likely be another build in the next several weeks to polish some things off before WWDC, so if you've encountered any issues, now's the time to let me know :)
|
||||
|
||||
|
|
|
@ -28,11 +28,25 @@ public class Client {
|
|||
|
||||
static let decoder: JSONDecoder = {
|
||||
let decoder = JSONDecoder()
|
||||
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SZ"
|
||||
formatter.timeZone = TimeZone(abbreviation: "UTC")
|
||||
formatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
decoder.dateDecodingStrategy = .formatted(formatter)
|
||||
let iso8601 = ISO8601DateFormatter()
|
||||
decoder.dateDecodingStrategy = .custom({ (decoder) in
|
||||
let container = try decoder.singleValueContainer()
|
||||
let str = try container.decode(String.self)
|
||||
// for the next time mastodon accidentally changes date formats >.>
|
||||
if let date = formatter.date(from: str) {
|
||||
return date
|
||||
} else if let date = iso8601.date(from: str) {
|
||||
return date
|
||||
} else {
|
||||
throw DecodingError.typeMismatch(Date.self, .init(codingPath: container.codingPath, debugDescription: "unexpected date format"))
|
||||
}
|
||||
})
|
||||
|
||||
return decoder
|
||||
}()
|
||||
|
||||
|
|
|
@ -2445,7 +2445,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = Tusker/Tusker.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 18;
|
||||
CURRENT_PROJECT_VERSION = 19;
|
||||
DEVELOPMENT_TEAM = V4WK9KR9U2;
|
||||
INFOPLIST_FILE = Tusker/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
|
||||
|
@ -2474,7 +2474,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = Tusker/Tusker.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 18;
|
||||
CURRENT_PROJECT_VERSION = 19;
|
||||
DEVELOPMENT_TEAM = V4WK9KR9U2;
|
||||
INFOPLIST_FILE = Tusker/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
|
||||
|
|
|
@ -57,7 +57,10 @@ class NotificationsTableViewController: TimelineLikeTableViewController<Notifica
|
|||
override func loadInitialItems(completion: @escaping ([NotificationGroup]) -> Void) {
|
||||
let request = Client.getNotifications(excludeTypes: excludedTypes)
|
||||
mastodonController.run(request) { (response) in
|
||||
guard case let .success(notifications, pagination) = response else { fatalError() }
|
||||
guard case let .success(notifications, pagination) = response else {
|
||||
completion([])
|
||||
return
|
||||
}
|
||||
|
||||
let groups = NotificationGroup.createGroups(notifications: notifications, only: self.groupTypes)
|
||||
|
||||
|
|
|
@ -99,6 +99,7 @@ class ProfileStatusesViewController: TimelineLikeTableViewController<TimelineEnt
|
|||
guard case let .success(statuses, pagination) = response,
|
||||
!statuses.isEmpty else {
|
||||
// todo: error message
|
||||
completion([])
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue