From 677888abbae2514e35add64fbfa0f7d93a71f860 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Thu, 5 Jan 2023 11:06:49 +0000 Subject: [PATCH] Minor fixes. (#406) * Use the links colour from Compound for links. * Avoid constantly recomputing the RoomScreen view hierarchy while scrolling. --- .../RoomScreen/View/Timeline/FormattedBodyText.swift | 3 +-- .../RoomScreen/View/TimelineTableViewController.swift | 9 +++++++-- changelog.d/pr-406.change | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 changelog.d/pr-406.change diff --git a/ElementX/Sources/Screens/RoomScreen/View/Timeline/FormattedBodyText.swift b/ElementX/Sources/Screens/RoomScreen/View/Timeline/FormattedBodyText.swift index 0ca1f074b..b5a05842e 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/Timeline/FormattedBodyText.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/Timeline/FormattedBodyText.swift @@ -51,8 +51,7 @@ struct FormattedBodyText: View { } } } - // Should be .element.accent but that's currently black - .tint(.blue) + .tint(.element.links) } private var blockquoteAttributes: AttributeContainer { diff --git a/ElementX/Sources/Screens/RoomScreen/View/TimelineTableViewController.swift b/ElementX/Sources/Screens/RoomScreen/View/TimelineTableViewController.swift index e6a8f1a73..cca2c10e0 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/TimelineTableViewController.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/TimelineTableViewController.swift @@ -358,8 +358,13 @@ class TimelineTableViewController: UIViewController { extension TimelineTableViewController: UITableViewDelegate { func scrollViewDidScroll(_ scrollView: UIScrollView) { - // Dispatches fix runtime warnings about making changes during a view update. - DispatchQueue.main.async { self.scrollToBottomButtonVisible = self.isAtBottom() } + let isAtBottom = isAtBottom() + + // Only update the binding on changes to avoid needlessly recomputing the hierarchy when scrolling. + if scrollToBottomButtonVisible != isAtBottom { + // Dispatch to fix runtime warning about making changes during a view update. + DispatchQueue.main.async { self.scrollToBottomButtonVisible = isAtBottom } + } paginateBackwardsPublisher.send(()) } diff --git a/changelog.d/pr-406.change b/changelog.d/pr-406.change new file mode 100644 index 000000000..c0975af33 --- /dev/null +++ b/changelog.d/pr-406.change @@ -0,0 +1 @@ +Use the links colour from Compound for links and avoid recomputing the RoomScreen view hierarchy while scrolling. \ No newline at end of file