|
@@ -609,6 +609,13 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
}
|
|
|
|
|
|
func displayTocViewAnimating(_ animate: Bool) {
|
|
|
+ if Thread.current.isMainThread {
|
|
|
+ self.tocOutlineView.reloadData()
|
|
|
+ } else {
|
|
|
+ Task { @MainActor in
|
|
|
+ self.tocOutlineView.reloadData()
|
|
|
+ }
|
|
|
+ }
|
|
|
if let data = self.tocOutlineView.enclosingScrollView {
|
|
|
self.replaceSideView(data, animate: animate)
|
|
|
}
|
|
@@ -1849,12 +1856,12 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
if let data = item as? String, data == Self.kOutlineRootBookmarkItem {
|
|
|
title = NSLocalizedString("Bookmarks", comment: "")
|
|
|
} else if let ol = item as? CPDFOutline {
|
|
|
- title = ol.label
|
|
|
+ title = ol.label ?? ""
|
|
|
if ol.actionType == .page {
|
|
|
pageLabel = "\((ol.destination?.pageIndex ?? 0) + 1)"
|
|
|
}
|
|
|
} else if let bk = item as? CPDFBookmark {
|
|
|
- title = bk.label
|
|
|
+ title = bk.label ?? ""
|
|
|
pageLabel = "\(bk.pageIndex + 1)"
|
|
|
}
|
|
|
|