Compare commits
2 Commits
ee630cf9df
...
5471d810c8
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 5471d810c8 | |
Shadowfacts | ad0a9ecafe |
|
@ -94,7 +94,7 @@ class ReblogService {
|
||||||
status.favourited = oldValue
|
status.favourited = oldValue
|
||||||
mastodonController.persistentContainer.statusSubject.send(status.id)
|
mastodonController.persistentContainer.statusSubject.send(status.id)
|
||||||
|
|
||||||
let title = oldValue ? "Error Unfavoriting" : "Error Favoriting"
|
let title = oldValue ? "Error Unreblogging" : "Error Reblogging"
|
||||||
let config = ToastConfiguration(from: error, with: title, in: presenter) { toast in
|
let config = ToastConfiguration(from: error, with: title, in: presenter) { toast in
|
||||||
toast.dismissToast(animated: true)
|
toast.dismissToast(animated: true)
|
||||||
await self.toggleReblog()
|
await self.toggleReblog()
|
||||||
|
|
|
@ -24,15 +24,17 @@ public final class AccountPreferences: NSManagedObject {
|
||||||
@NSManaged var createdAt: Date
|
@NSManaged var createdAt: Date
|
||||||
@NSManaged var pinnedTimelinesData: Data?
|
@NSManaged var pinnedTimelinesData: Data?
|
||||||
|
|
||||||
@LazilyDecoding(from: \AccountPreferences.pinnedTimelinesData, fallback: [])
|
@LazilyDecoding(from: \AccountPreferences.pinnedTimelinesData, fallback: AccountPreferences.defaultPinnedTimelines)
|
||||||
var pinnedTimelines: [PinnedTimeline]
|
var pinnedTimelines: [PinnedTimeline]
|
||||||
|
|
||||||
static func `default`(account: LocalData.UserAccountInfo, context: NSManagedObjectContext) -> AccountPreferences {
|
static func `default`(account: LocalData.UserAccountInfo, context: NSManagedObjectContext) -> AccountPreferences {
|
||||||
let prefs = AccountPreferences(context: context)
|
let prefs = AccountPreferences(context: context)
|
||||||
prefs.accountID = account.id
|
prefs.accountID = account.id
|
||||||
prefs.createdAt = Date()
|
prefs.createdAt = Date()
|
||||||
prefs.pinnedTimelines = [.home, .public(local: true), .public(local: false)]
|
prefs.pinnedTimelines = Self.defaultPinnedTimelines
|
||||||
return prefs
|
return prefs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static let defaultPinnedTimelines = [PinnedTimeline.home, .public(local: true), .public(local: false)]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue