Compare commits
3 Commits
56a0518c80
...
0b6c16b0a6
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 0b6c16b0a6 | |
Shadowfacts | 5f566724bb | |
Shadowfacts | 4a89ae3cfe |
|
@ -61,6 +61,7 @@ extension AccountMO {
|
||||||
convenience init(apiAccount account: Pachyderm.Account, container: MastodonCachePersistentStore, context: NSManagedObjectContext) {
|
convenience init(apiAccount account: Pachyderm.Account, container: MastodonCachePersistentStore, context: NSManagedObjectContext) {
|
||||||
self.init(context: context)
|
self.init(context: context)
|
||||||
self.updateFrom(apiAccount: account, container: container)
|
self.updateFrom(apiAccount: account, container: container)
|
||||||
|
self.lastFetchedAt = Date()
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateFrom(apiAccount account: Pachyderm.Account, container: MastodonCachePersistentStore) {
|
func updateFrom(apiAccount account: Pachyderm.Account, container: MastodonCachePersistentStore) {
|
||||||
|
|
|
@ -91,6 +91,7 @@ extension StatusMO {
|
||||||
convenience init(apiStatus status: Pachyderm.Status, container: MastodonCachePersistentStore, context: NSManagedObjectContext) {
|
convenience init(apiStatus status: Pachyderm.Status, container: MastodonCachePersistentStore, context: NSManagedObjectContext) {
|
||||||
self.init(context: context)
|
self.init(context: context)
|
||||||
self.updateFrom(apiStatus: status, container: container)
|
self.updateFrom(apiStatus: status, container: container)
|
||||||
|
self.lastFetchedAt = Date()
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateFrom(apiStatus status: Pachyderm.Status, container: MastodonCachePersistentStore) {
|
func updateFrom(apiStatus status: Pachyderm.Status, container: MastodonCachePersistentStore) {
|
||||||
|
|
|
@ -52,6 +52,9 @@ struct ComposeEmojiTextField: UIViewRepresentable {
|
||||||
|
|
||||||
view.backgroundColor = backgroundColor
|
view.backgroundColor = backgroundColor
|
||||||
|
|
||||||
|
// otherwise when the text gets too wide it starts expanding the ComposeView
|
||||||
|
view.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
||||||
|
|
||||||
context.coordinator.textField = view
|
context.coordinator.textField = view
|
||||||
context.coordinator.uiState = uiState
|
context.coordinator.uiState = uiState
|
||||||
context.coordinator.text = $text
|
context.coordinator.text = $text
|
||||||
|
|
|
@ -59,7 +59,7 @@ extension MenuActionProvider {
|
||||||
draft.visibility = .direct
|
draft.visibility = .direct
|
||||||
self.navigationDelegate?.compose(editing: draft)
|
self.navigationDelegate?.compose(editing: draft)
|
||||||
}),
|
}),
|
||||||
UIDeferredMenuElement({ (elementHandler) in
|
UIDeferredMenuElement.uncachedIfPossible({ (elementHandler) in
|
||||||
Task { @MainActor in
|
Task { @MainActor in
|
||||||
if let action = await self.followAction(for: accountID, mastodonController: mastodonController) {
|
if let action = await self.followAction(for: accountID, mastodonController: mastodonController) {
|
||||||
elementHandler([action])
|
elementHandler([action])
|
||||||
|
@ -339,3 +339,13 @@ extension SFSafariViewController: CustomPreviewPresenting {
|
||||||
presenter.present(self, animated: true)
|
presenter.present(self, animated: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extension UIDeferredMenuElement {
|
||||||
|
static func uncachedIfPossible(_ elementProvider: @escaping (@escaping ([UIMenuElement]) -> Void) -> Void) -> UIDeferredMenuElement {
|
||||||
|
if #available(iOS 15.0, *) {
|
||||||
|
return UIDeferredMenuElement.uncached(elementProvider)
|
||||||
|
} else {
|
||||||
|
return UIDeferredMenuElement(elementProvider)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue