From 3c2c17df0dc99835856b71a1e4941de5296a598b Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 25 Mar 2021 16:28:15 -0500 Subject: [PATCH] Fix threading issue --- .../MasterTimelineViewController.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index d92638b33..27462c202 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -471,13 +471,15 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner } @objc func userDefaultsDidChange(_ note: Notification) { - if numberOfTextLines != AppDefaults.shared.timelineNumberOfLines || iconSize != AppDefaults.shared.timelineIconSize { - numberOfTextLines = AppDefaults.shared.timelineNumberOfLines - iconSize = AppDefaults.shared.timelineIconSize - resetEstimatedRowHeight() - reloadAllVisibleCells() + DispatchQueue.main.async { + if self.numberOfTextLines != AppDefaults.shared.timelineNumberOfLines || self.iconSize != AppDefaults.shared.timelineIconSize { + self.numberOfTextLines = AppDefaults.shared.timelineNumberOfLines + self.iconSize = AppDefaults.shared.timelineIconSize + self.resetEstimatedRowHeight() + self.reloadAllVisibleCells() + } + self.updateToolbar() } - updateToolbar() } @objc func contentSizeCategoryDidChange(_ note: Notification) {