From 1196a0f831e5bcf44a1003a754652409e48462b3 Mon Sep 17 00:00:00 2001 From: zhongsheng <371960474@qq.com> Date: Sun, 8 Oct 2023 18:29:39 +0800 Subject: [PATCH] Update SearchResultViewController.swift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决第二次搜索崩溃问题(哈希键重复) --- BilibiliLive/Module/Personal/SearchResultViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BilibiliLive/Module/Personal/SearchResultViewController.swift b/BilibiliLive/Module/Personal/SearchResultViewController.swift index 1a35adc7..8647a149 100644 --- a/BilibiliLive/Module/Personal/SearchResultViewController.swift +++ b/BilibiliLive/Module/Personal/SearchResultViewController.swift @@ -40,7 +40,8 @@ class SearchResultViewController: UIViewController { WebRequest.requestSearchResult(key: key) { [weak self] searchResult in guard let self = self else { return } currentSnapshot.deleteAllItems() - + dataSource.apply(currentSnapshot) + let defaultHeight = NSCollectionLayoutDimension.fractionalWidth(Settings.displayStyle == .large ? 0.26 : 0.2) for section in searchResult.result { switch section {