From f41d620c7aaf732bba1659a548e5c67c31711c12 Mon Sep 17 00:00:00 2001 From: Michal Rentka Date: Wed, 19 Feb 2025 13:02:36 +0100 Subject: [PATCH] Fixed datasource regression --- .../Detail/PDF/Views/PDFAnnotationsViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotero/Scenes/Detail/PDF/Views/PDFAnnotationsViewController.swift b/Zotero/Scenes/Detail/PDF/Views/PDFAnnotationsViewController.swift index 312fda549..cf72513f6 100644 --- a/Zotero/Scenes/Detail/PDF/Views/PDFAnnotationsViewController.swift +++ b/Zotero/Scenes/Detail/PDF/Views/PDFAnnotationsViewController.swift @@ -216,8 +216,8 @@ final class PDFAnnotationsViewController: UIViewController { if state.changes.contains(.library) { updateQueue.async { [weak self] in - guard let self else { return } - var snapshot = NSDiffableDataSourceSnapshot() + guard let self, !dataSource.snapshot().sectionIdentifiers.isEmpty else { return } + var snapshot = dataSource.snapshot() snapshot.reloadSections([0]) dataSource.apply(snapshot, animatingDifferences: isVisible, completion: completion) }