Compare commits
No commits in common. "86862825f67affd865aa90d994aa998a9537cfb5" and "e57ef210fd1df4073fb0ec3d3fcbb128dcb4dd78" have entirely different histories.
86862825f6
...
e57ef210fd
|
@ -20,11 +20,7 @@ public final class ComposeController: ViewController {
|
|||
public typealias ReplyContentView = (any StatusProtocol, @escaping (CGFloat) -> Void) -> AnyView
|
||||
public typealias EmojiImageView = (Emoji) -> AnyView
|
||||
|
||||
@Published public private(set) var draft: Draft {
|
||||
didSet {
|
||||
assert(draft.managedObjectContext == DraftsPersistentContainer.shared.viewContext)
|
||||
}
|
||||
}
|
||||
@Published public private(set) var draft: Draft
|
||||
@Published public var config: ComposeUIConfig
|
||||
@Published public var mastodonController: ComposeMastodonContext
|
||||
let fetchAvatar: AvatarImageView.FetchAvatar
|
||||
|
@ -110,7 +106,6 @@ public final class ComposeController: ViewController {
|
|||
emojiImageView: @escaping EmojiImageView
|
||||
) {
|
||||
self.draft = draft
|
||||
assert(draft.managedObjectContext == DraftsPersistentContainer.shared.viewContext)
|
||||
self.config = config
|
||||
self.mastodonController = mastodonController
|
||||
self.fetchAvatar = fetchAvatar
|
||||
|
|
|
@ -35,7 +35,7 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDelegate
|
|||
window = UIWindow(windowScene: windowScene)
|
||||
|
||||
showAppOrOnboardingUI(session: session)
|
||||
if !connectionOptions.urlContexts.isEmpty {
|
||||
if connectionOptions.urlContexts.count > 0 {
|
||||
self.scene(scene, openURLContexts: connectionOptions.urlContexts)
|
||||
}
|
||||
|
||||
|
@ -50,21 +50,14 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDelegate
|
|||
}
|
||||
|
||||
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
|
||||
guard let url = URLContexts.first?.url,
|
||||
var components = URLComponents(url: url, resolvingAgainstBaseURL: false),
|
||||
let rootViewController else {
|
||||
return
|
||||
if URLContexts.count > 1 {
|
||||
fatalError("Cannot open more than 1 URL")
|
||||
}
|
||||
|
||||
if components.host == "compose" {
|
||||
if let mastodonController = window!.windowScene!.session.mastodonController {
|
||||
let draft = mastodonController.createDraft()
|
||||
let text = components.queryItems?.first(where: { $0.name == "text" })?.value
|
||||
draft.text = text ?? ""
|
||||
rootViewController.compose(editing: draft, animated: true, isDucked: false)
|
||||
}
|
||||
} else {
|
||||
// Assume anything else is a search query
|
||||
let url = URLContexts.first!.url
|
||||
|
||||
if var components = URLComponents(url: url, resolvingAgainstBaseURL: false),
|
||||
let rootViewController = rootViewController {
|
||||
components.scheme = "https"
|
||||
let query = components.string!
|
||||
rootViewController.performSearch(query: query)
|
||||
|
|
|
@ -211,10 +211,9 @@ extension TimelineLikeCollectionViewController {
|
|||
extension TimelineLikeCollectionViewController {
|
||||
// apply(_:animatingDifferences:) is marked as nonisolated, so just awaiting it doesn't dispatch to the main thread, unlike other async @MainActor methods
|
||||
// but we always want to update the data source on the main thread for consistency, so this method does that
|
||||
@MainActor
|
||||
func apply(_ snapshot: NSDiffableDataSourceSnapshot<Section, Item>, animatingDifferences: Bool) async {
|
||||
await MainActor.run {
|
||||
dataSource?.apply(snapshot, animatingDifferences: animatingDifferences)
|
||||
}
|
||||
await self.dataSource.apply(snapshot, animatingDifferences: animatingDifferences)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
|
|
Loading…
Reference in New Issue