Continue adopting async/await.

This commit is contained in:
Brent Simmons
2023-07-10 21:19:28 -07:00
parent ed8a445a72
commit 0402bd607f
3 changed files with 39 additions and 31 deletions
+12 -5
View File
@@ -310,9 +310,15 @@ enum TimelineSourceMode {
guard let detailViewController = detailViewController else {
return
}
detailViewController.canScrollDown { (canScroll) in
Task { @MainActor in
let canScroll = await detailViewController.canScrollDown()
NSCursor.setHiddenUntilMouseMoves(true)
canScroll ? detailViewController.scrollPageDown(sender) : self.nextUnread(sender)
if canScroll {
detailViewController.scrollPageDown(sender)
} else {
nextUnread(sender)
}
}
}
@@ -320,13 +326,14 @@ enum TimelineSourceMode {
guard let detailViewController = detailViewController else {
return
}
detailViewController.canScrollUp { (canScroll) in
if (canScroll) {
Task { @MainActor in
let canScroll = await detailViewController.canScrollUp()
if canScroll {
NSCursor.setHiddenUntilMouseMoves(true)
detailViewController.scrollPageUp(sender)
}
}
}
@IBAction func copyArticleURL(_ sender: Any?) {